From which module jar my class is loaded?

pjodeleit
e-Spirit employee
0 1 171

Just recently someone came up with a problem that after updating a module the changes made in some classes had no effect. The classes behaved like the update did not happen.

After controlling the obvious things (module version, server class path) I came up with the follwing script:

import customer.package.CustomerClass;

System.out.println(context.getConnection().getClassLoader().getResource(CustomerClass.class.getName().replace('.', '/') + ".class")));

This will output a file name which contains the jar name in question (e.g. something like "...C:\Users\username\.firstspirit_5.2R0\jars\bb0e10b9@myclasses.jar...".).

In the situation mentioned above this revealed that the class was also included in a jar of another module which wasn't updated.

1 Comment