You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ashish Kulkarni <as...@gmail.com> on 2012/02/14 22:36:36 UTC

Error configuring JNDIRealm in tomcat 6.0.2 in eclipse, trying to connect to localhost:389

I am trying to configure JNDIRealm in tomcat running as eclipse plugin, so
i copied ldap.jar in to lib folder, then modified server.xml in my eclipse
like below

<Realm  className="org.apache.catalina.realm.JNDIRealm" debug="99"
>      connnectionURL="ldap://myldap.com:389"
>      alternateURL="ldap://myldap.com:389"
>      connectionName="CN=user,OU=Enterprise Users,DC=tauck,DC=com"
>      connectionPassword="password"
>      userBase="OU=All Objects,DC=tauck,DC=com"
>      userSearch="(name={0})"
>      userSubtree="true"
>      roleBase="OU=roles,OU=Application Roles,DC=tauck,DC=com"
>      roleName="cn"
>      roleSearch="(member={0})"
>      roleSubtree="true"
> />


In my log file i see it is trying to connect to localhost:389, i dont
understand what i am missing

Feb 14, 2012 4:17:01 PM org.apache.catalina.realm.JNDIRealm open
> WARNING: Exception performing authentication
> javax.naming.CommunicationException: localhost:389 [Root exception is
> java.net.ConnectException: Connection refused: connect]
> at com.sun.jndi.ldap.Connection.<init>(Connection.java:208)
> at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:116)
> at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1580)
> at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2678)
> at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:296)
> at
> com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:53)
> at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
> at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
> 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:1624)
> at org.apache.catalina.realm.JNDIRealm.start(JNDIRealm.java:1713)
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1037)
> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
> at org.apache.catalina.core.StandardService.start(StandardService.java:516)
> at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
> 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:597)
> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> Caused by: java.net.ConnectException: Connection refused: connect

-- 
Ashish
www.ayurwellness.com
www.mysoftwareneeds.com

Re: Error configuring JNDIRealm in tomcat 6.0.2 in eclipse, trying to connect to localhost:389

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/2/15 Ashish Kulkarni <as...@gmail.com>:
> I have another question, how can i configure in web.xml so that all roles
> has authority to login, then in my application i control what is displayed
> to the user?
>

If you have a different question, then start a new thread with a new
blank e-mail. Do not reply to an existing one.

See also:
http://www.catb.org/~esr/faqs/smart-questions.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Error configuring JNDIRealm in tomcat 6.0.2 in eclipse, trying to connect to localhost:389

Posted by Ashish Kulkarni <as...@gmail.com>.
I have another question, how can i configure in web.xml so that all roles
has authority to login, then in my application i control what is displayed
to the user?

Ashish

On Tue, Feb 14, 2012 at 5:11 PM, Ashish Kulkarni <
ashish.kulkarni13@gmail.com> wrote:

> Hi
> Thanks very much, as i removed extra n it worked fine,
>
>
>
> On Tue, Feb 14, 2012 at 4:48 PM, Konstantin Kolinko <
> knst.kolinko@gmail.com> wrote:
>
>> 2012/2/15 Ashish Kulkarni <as...@gmail.com>:
>> > I am trying to configure JNDIRealm in tomcat running as eclipse plugin,
>> so
>> > i copied ldap.jar in to lib folder, then modified server.xml in my
>> eclipse
>> > like below
>> >
>> > <Realm  className="org.apache.catalina.realm.JNDIRealm" debug="99"
>> >>      connnectionURL="ldap://myldap.com:389"
>> >>      alternateURL="ldap://myldap.com:389"
>> >>      connectionName="CN=user,OU=Enterprise Users,DC=tauck,DC=com"
>> >>      connectionPassword="password"
>> >>      userBase="OU=All Objects,DC=tauck,DC=com"
>> >>      userSearch="(name={0})"
>> >>      userSubtree="true"
>> >>      roleBase="OU=roles,OU=Application Roles,DC=tauck,DC=com"
>> >>      roleName="cn"
>> >>      roleSearch="(member={0})"
>> >>      roleSubtree="true"
>> >> />
>> >
>> >
>> > In my log file i see it is trying to connect to localhost:389, i dont
>> > understand what i am missing
>>
>> Verify that all attributes that you are use are spelled exactly as in
>> documentation.
>>
>> There is no attribute named "connnectionURL" (with three 'n' characters).
>>
>> There should be a warning in the logs about failing to assign value to
>> an attribute. Recent versions of Tomcat 6 would print one when parsing
>> server.xml, but I do not know what version of 6.0.x you are using.
>>
>>
>> >
>> > Feb 14, 2012 4:17:01 PM org.apache.catalina.realm.JNDIRealm open
>> >> WARNING: Exception performing authentication
>> >> javax.naming.CommunicationException: localhost:389 [Root exception is
>> >> java.net.ConnectException: Connection refused: connect]
>>
>> Best regards,
>> Konstantin Kolinko
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> --
> Ashish
> www.ayurwellness.com
> www.mysoftwareneeds.com
>



-- 
Ashish
www.ayurwellness.com
www.mysoftwareneeds.com

Re: Error configuring JNDIRealm in tomcat 6.0.2 in eclipse, trying to connect to localhost:389

Posted by Ashish Kulkarni <as...@gmail.com>.
Hi
Thanks very much, as i removed extra n it worked fine,



On Tue, Feb 14, 2012 at 4:48 PM, Konstantin Kolinko
<kn...@gmail.com>wrote:

> 2012/2/15 Ashish Kulkarni <as...@gmail.com>:
> > I am trying to configure JNDIRealm in tomcat running as eclipse plugin,
> so
> > i copied ldap.jar in to lib folder, then modified server.xml in my
> eclipse
> > like below
> >
> > <Realm  className="org.apache.catalina.realm.JNDIRealm" debug="99"
> >>      connnectionURL="ldap://myldap.com:389"
> >>      alternateURL="ldap://myldap.com:389"
> >>      connectionName="CN=user,OU=Enterprise Users,DC=tauck,DC=com"
> >>      connectionPassword="password"
> >>      userBase="OU=All Objects,DC=tauck,DC=com"
> >>      userSearch="(name={0})"
> >>      userSubtree="true"
> >>      roleBase="OU=roles,OU=Application Roles,DC=tauck,DC=com"
> >>      roleName="cn"
> >>      roleSearch="(member={0})"
> >>      roleSubtree="true"
> >> />
> >
> >
> > In my log file i see it is trying to connect to localhost:389, i dont
> > understand what i am missing
>
> Verify that all attributes that you are use are spelled exactly as in
> documentation.
>
> There is no attribute named "connnectionURL" (with three 'n' characters).
>
> There should be a warning in the logs about failing to assign value to
> an attribute. Recent versions of Tomcat 6 would print one when parsing
> server.xml, but I do not know what version of 6.0.x you are using.
>
>
> >
> > Feb 14, 2012 4:17:01 PM org.apache.catalina.realm.JNDIRealm open
> >> WARNING: Exception performing authentication
> >> javax.naming.CommunicationException: localhost:389 [Root exception is
> >> java.net.ConnectException: Connection refused: connect]
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Ashish
www.ayurwellness.com
www.mysoftwareneeds.com

Re: Error configuring JNDIRealm in tomcat 6.0.2 in eclipse, trying to connect to localhost:389

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/2/15 Ashish Kulkarni <as...@gmail.com>:
> I am trying to configure JNDIRealm in tomcat running as eclipse plugin, so
> i copied ldap.jar in to lib folder, then modified server.xml in my eclipse
> like below
>
> <Realm  className="org.apache.catalina.realm.JNDIRealm" debug="99"
>>      connnectionURL="ldap://myldap.com:389"
>>      alternateURL="ldap://myldap.com:389"
>>      connectionName="CN=user,OU=Enterprise Users,DC=tauck,DC=com"
>>      connectionPassword="password"
>>      userBase="OU=All Objects,DC=tauck,DC=com"
>>      userSearch="(name={0})"
>>      userSubtree="true"
>>      roleBase="OU=roles,OU=Application Roles,DC=tauck,DC=com"
>>      roleName="cn"
>>      roleSearch="(member={0})"
>>      roleSubtree="true"
>> />
>
>
> In my log file i see it is trying to connect to localhost:389, i dont
> understand what i am missing

Verify that all attributes that you are use are spelled exactly as in
documentation.

There is no attribute named "connnectionURL" (with three 'n' characters).

There should be a warning in the logs about failing to assign value to
an attribute. Recent versions of Tomcat 6 would print one when parsing
server.xml, but I do not know what version of 6.0.x you are using.


>
> Feb 14, 2012 4:17:01 PM org.apache.catalina.realm.JNDIRealm open
>> WARNING: Exception performing authentication
>> javax.naming.CommunicationException: localhost:389 [Root exception is
>> java.net.ConnectException: Connection refused: connect]

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org