com.sun.jndi.ldap.LdapCtxFactory is present in a jar called ldap.jar which i have specifed in my classpath. Also set the nobody as the file owner and its prviligies to 777
Using truss i can confirm that the webserver does resolve and get a filehandle to the ldap.jar file.
has anyone come across a similar problem where the class could not be initiated despite being present in the classpath.
Appricate if you could provide some answers.
Mods: In case this topic has been answered before, could you point me to the right forum please.
Applications running inside servlet containers don't use the classpath, ignoring it allows a single container to run multiple applications without their code bases interfering with each other.
I'll move this to the Sun One forum, but basically you should put ldap.jar in the lib directory for that domain.
sandesh bangera
Greenhorn
Joined: Nov 13, 2002
Posts: 12
posted
0
Thanks David.
I will try this out first thing on Monday.
sandesh bangera
Greenhorn
Joined: Nov 13, 2002
Posts: 12
posted
0
Fixed this. this is due to the different class loaders introduced in JDK 2 onwards. Did hte following to fix my problem
//Retrive and store previous Class context. ClassLoader prevCl = Thread.currentThread().getContextClassLoader();
try{
// Get the current classes Class loader info ClassLoader classcl = this.getClass().getClassLoader();
//Set class context loader to the current thread Thread.currentThread().setContextClassLoader(classcl);
Hashtable env = new Hashtable(5, 0.75F); env.put(Context.INITIAL_CONTEXT_FACTORY,.....) ....