Code in external jar can't access classloader . .

I have a java agent that uses the jakarta digester component. I have the digester jars on the Notes classpath using the JavaUserClasses property in the notes.ini. I get a NullPointerException at runtime from the digester class when it attempts to load my class. I have narrowed the problem down to the ObjectCreateRule.begin method, this line:Class clazz = digester.getClassLoader().loadClass(realClassName);

I have also found that from this same method, this.getClass().getClassLoader() returns null.

The same line in my agent does not return null. I thought this might be related to the security policy so I added the following to my java.security file:

grant {

permission java.security.AllPermission;

};

This did not solve my problem. Any ideas? I need to be able to access the classloader from the classes in the jarfiles.

Subject: Code in external jar can’t access classloader . . .

Where you added the grant, did you specify the codebase? I believe that it should look something like this:

// Try allowing all permissions here…

grant codeBase “file:c:/java/JMagick5.5.6/jmagick.jar” {

permission java.security.AllPermission;

};

This solved the classLoader exception for me.

An alternative is to place the jar file into the jvm/lib/ext directory, which already has these permissions.

Let us know if you get it fixed.

David.