dcsimg
LDAP java.policy enabling??
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sim_Simbo
Posted On:   Wednesday, February 18, 2004 01:21 AM

Hi all, I am trying to write an application to connect to LDAP server and retrieve employee info..I am using J++, and i installed the relevant packages, i think, since i dont get any compiling problems, and this is my code: Hashtable environment = new Hashtable(); environment.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory") environment.put(Context.PROVIDER_URL,"ldap://172.62.44.3:389"); try { InitialDirContext root = new InitialDirContext(environment);//error NoClassDefFoundError is thrown here MessageBox.show("Connection Successful"); root.close(); } catch(NamingExce   More>>

Hi all,
I am trying to write an application to connect to LDAP server and retrieve employee info..I am using J++, and i installed the relevant packages, i think, since i dont get any compiling problems, and this is my code:


Hashtable environment = new Hashtable();

environment.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory")


environment.put(Context.PROVIDER_URL,"ldap://172.62.44.3:389");


try
{

InitialDirContext root = new InitialDirContext(environment);//error NoClassDefFoundError is thrown here


MessageBox.show("Connection Successful");

root.close();
}

catch(NamingException ex)
{

MessageBox.show("Sorry Connection Unsuccessful"+"Error: "+ ex);
}

}

So the key thing is how and where do i give the correct permissions for the java.policy file?is there any other way i could do it?

I would appreciate any help greatly, thankyou.


Kind regards,


Sim

   <<Less
About | Sitemap | Contact