I'm in trouble with connecting Active Directory. The codes in question is 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 I debug it, it gives me an error:
javax.naming.CommunicationException: 192.168.0.100:389 [Root Exception is java.security.AccessControlException: access denied ("java.net.SocketPermission" "192.168.0.100:389" "connect.resolve")]
An IP I'm trying to connect is 192.168.0.99 (Windows 7) 192.168.0.100 is installed Windows 2008, and I double-checked that the connection doesn't have any problems when I try to connect from 192.168.0.100 itself. Could you give me a piece of advice please? I'm happy to provide more information if needed