Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java LDAP tomcat jndiream_Java_Tomcat_Ssl_Ldap - Fatal编程技术网

Java LDAP tomcat jndiream

Java LDAP tomcat jndiream,java,tomcat,ssl,ldap,Java,Tomcat,Ssl,Ldap,我正在使用下面的server.xml文件配置tomcat,以使用JNDIRealm连接到ldap服务器 然而,我不断得到错误: 原因:javax.naming.CommunicationException:localhost:389[根异常为java.net.ConnectException:连接被拒绝:连接] 我没有使用localhost:389,如果您看到我的连接url使用的是主机和636端口。那么连接到localhost:389是什么原因呢 下面是server.xml: <?xml

我正在使用下面的server.xml文件配置tomcat,以使用JNDIRealm连接到ldap服务器

然而,我不断得到错误:

原因:javax.naming.CommunicationException:localhost:389[根异常为java.net.ConnectException:连接被拒绝:连接]

我没有使用localhost:389,如果您看到我的连接url使用的是主机和636端口。那么连接到localhost:389是什么原因呢

下面是server.xml:

<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
          type="org.apache.catalina.UserDatabase"
          description="User database that can be updated and saved"
          factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
          pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" 
 SSLEnabled="true" maxThreads="150" scheme="https" secure="true" 
 keystoreFile="keystore_key.jks" keystoreType="JKS" 
 keystorePass="xxxxx" URIEncoding="UTF-8" clientAuth="false" sslProtocol="TLS" /> 
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">    
<Realm className="org.apache.catalina.realm.JNDIRealm"
            connectionURL="ldap://mycomapny.org:636" 
            userSubtree="true"
            userBase="DC=test,DC=win,DC=user,DC=org" 
            userSearch="(&amp;(sAMAccountName={0})(objectcategory=user))"
            userRoleName="memberOf" 
            roleBase="DC=test,DC=win,DC=user,DC=org" 
            roleName="cn"
            roleSearch="(member={0})" 
            roleSubtree="true" 
            roleNested="true"/>
<Host name="localhost" appBase="webapps">
            <Context docBase="spnego" path="">
                <Valve className="org.apache.catalina.authenticator.SpnegoAuthenticator"
                    storeDelegatedCredential="true" />
            </Context>
        </Host>
</Engine>
</Service>
</Server>

您是否尝试在connectionURL设置中指定LDAP,即。 connectionURL=”ldaps://mycompany.org:636"


端口389用于非安全连接

是否至少有人可以指导我使用JNDIRealm设置ldap的任何指南/步骤?您的URL拼写错误。