我正在尝试连接建模为IPv6地址的LDAP服务器,但是获取NumberFormatException。
以下是我的代码:
environment.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
environment.put(Context.PROVIDER_URL, "ldap://" + "[2001:1b70:4294:ff0f:0000:0000:0000:0104]" + ":" + "7423");
try {
ldapContext = new InitialDirContext(environment);
} catch (NamingException e) {
}
非常感谢您的帮助。