i'm in trouble connecting active directory. codes in question following:
hashtable<stirng,string> env = new hashtable<string,string>(); env.put(context.initial_context_factory,"com.sun.jndi.ldap.ldapctxfactory"); env.put(context.provider_url,"ldap://192.168.0.100:389"); env.put(context.security_authentication,"simple"); env.put(context.security_principal,"test\\administrator"); env.put(context.security_credentials,"password"); ldapcontext ctx = new initialldapcontext(env, null);
when debug it, gives me error:
javax.naming.communicationexception: 192.168.0.100:389 [root exception java.security.accesscontrolexception: access denied ("java.net.socketpermission" "192.168.0.100:389" "connect.resolve")]
an ip i'm trying connect 192.168.0.99 (windows 7) 192.168.0.100 installed windows 2008, , double-checked connection doesn't have problems when try connect 192.168.0.100 itself. give me piece of advice please? i'm happy provide more information if needed
i found out wrong. added
grant { permission java.net.socketpermission "*:1024-65535","connect,accept,resolve"; permission java.net.socketpermission "*:1-1023","connect,resolve"; };
in policy file (which catalina.policy me) then, added statement in arguments of run configuration in eclipse as:
-djava.security.policy="c:\catalina.policy"
thanks
Comments
Post a Comment