Hi,

I want to use JNDIRealm.

I write this in the server.xml :

 <Realm className="org.apache.catalina.realm.JNDIRealm"
            debug="99"
            connectionName="uid=tomcat,ou=xx,dc=xx,dc=fr"
            connectionPassword="g72jfacc"
            connectionURL="ldap://ldapmasta:1389";
            userBase="ou=people,dc=xx,dc=fr"
            userSearch="(uid={0})"
            roleBase="ou=appli,dc=xx,dc=fr"
            roleName="cn"
            roleSearch="(uniqueMember={0})"
            roleSubtree="true"
            />

Before that, I makes an authentification sso by LDAP and according to the
user group, I grant or not the accesses. So I want to use Realm

I don't know if my configuration is corectly but I have this error

WARNING: Exception performing authentication
javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid
Credentials]
       at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:2985)
       at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2931)
       at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2732)
       at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2646)
       at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:283)
       at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java
:175)
       at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java
:193)
       at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(
LdapCtxFactory.java:136)
       at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(
LdapCtxFactory.java:66)
       at javax.naming.spi.NamingManager.getInitialContext(
NamingManager.java:667)
       at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java
:247)
       at javax.naming.InitialContext.init(InitialContext.java:223)
       at javax.naming.InitialContext.<init>(InitialContext.java:197)
       at javax.naming.directory.InitialDirContext.<init>(
InitialDirContext.java:82)
       at org.apache.catalina.realm.JNDIRealm.open(JNDIRealm.java:1575)
       at org.apache.catalina.realm.JNDIRealm.start(JNDIRealm.java:1664)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java
:1006)
       at org.apache.catalina.core.StandardEngine.start(StandardEngine.java
:443)
       at org.apache.catalina.core.StandardService.start(
StandardService.java:448)
       at org.apache.catalina.core.StandardServer.start(StandardServer.java
:700)
       at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Apr 20, 2007 1:51:23 PM org.apache.catalina.startup.Catalina start
SEVERE: Catalina.start:
LifecycleException:  Exception opening directory server connection:
javax.naming.CommunicationException: localhost:389 [Root exception is
java.net.ConnectException: Connection refused]
       at org.apache.catalina.realm.JNDIRealm.start(JNDIRealm.java:1666)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java
:1006)
       at org.apache.catalina.core.StandardEngine.start(StandardEngine.java
:443)
       at org.apache.catalina.core.StandardService.start(
StandardService.java:448)
       at org.apache.catalina.core.StandardServer.start(StandardServer.java
:700)
       at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)


However in my code, it is never specified: localhost:389 :\

Can you help me?

Cordially

Aurelien Allienne

Reply via email to