I’m having a problem getting a Java agent to properly load imported classes. The agent does JNDI lookups to an Active Directory LDAP server.
Here’s the problem: the agent runs fine on my Notes 5.0.10 client, but throws a java.lang.NoClassDefFoundError when it try to run it on the server. (Apologies: I’m actually running this on a Domino 5.0.12 server on Windows, but I’m posting the question here because the R4/R5 forum doesn’t get much attention.)
The agent relies on three standard libraries: jndi.jar, ldap.jar and providerutil.jar. All are included in the agent via Edit Project. I’ve taken this approach (rather than using JavaUserClasses= in Notes.ini) because I want to deploy this agent to several servers and I’m trying to avoid a dependency on the presence of these jar library files on each box. The agent is launched from LotusScript via RunOnServer().
My client machine does not have a JavaUserClasses= line in Notes.ini, but the development server has the following setting (put in place to support Java agents in other apps):
JavaUserClasses=D:\lotus\domino\providerutil.jar;D:\lotus\domino\mail.jar;D:\lotus\domino\activation.jar;
The import statements for my agent are as follows:
import lotus.domino.*;
import javax.naming.*;
import javax.naming.directory.*;
import java.util.Hashtable;
import java.util.Vector;
and the error appears to be generated by the following line (the agent runs fine through all the code setting up the Hashtable for the context):
DirContext ctx = new InitialDirContext(env);
Can anyone tell me why using the InitialDirContext class is throwing this error on the server, but not on the client?
I found a posting from Joseph Millar (http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/ab82e1bf2e775c1d85256bc0006f0549?OpenDocument) that indicates that classes loaded via JavaUserClasses are system classes shared across all class instances. Does that indicate there’s some conflict becauae providerutil.jar is specified both in JavaUserClasses and directly in the agent?
Any suggestions or advice would be greatkly welcomed!
Thanks,
Rupert Clayton
Chicago