From which module jar my class is loaded?

Peter_Jodeleit
Crownpeak employee
Crownpeak employee
0 1 565

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
Version history
Last update:
‎05-02-2014 01:38 AM
Updated by: