You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/02/10 10:48:12 UTC

DO NOT REPLY [Bug 52636] New: JNDIRealm fails with CommunicationException and SocketTimeoutException

https://issues.apache.org/bugzilla/show_bug.cgi?id=52636

             Bug #: 52636
           Summary: JNDIRealm fails with CommunicationException and
                    SocketTimeoutException
           Product: Tomcat 6
           Version: 6.0.26
          Platform: PC
        OS/Version: Windows Server 2003
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: colin.schaefer@beeline-group.com
    Classification: Unclassified


Hi,

33774 and 50775 address the same symptom but apparently different causes. 33774
describes exactly what I am experiencing.

The tomcat was running fine on Windows Server 2003 in a 2003 ActiveDirectory.
No timeouts or issues then, authentication worked without timeouts or errors.
We just recently migrated the ActiveDirectory to 2008 R2, then this problem
started to occur. The server running the tomcat Server itself was not changed
in any way.

Here is my log output:

10.02.2012 10:08:33 org.apache.catalina.realm.JNDIRealm authenticate
SCHWERWIEGEND: Exception performing authentication
javax.naming.PartialResultException [Root exception is
javax.naming.CommunicationException: xxx.xxxxxx.xx:389 [Root exception is
java.net.SocketTimeoutException: connect timed out]]
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreImpl(Unknown Source)
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreReferrals(Unknown Source)
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreImpl(Unknown Source)
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreReferrals(Unknown Source)
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreImpl(Unknown Source)
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMore(Unknown Source)
    at org.apache.catalina.realm.JNDIRealm.getUserBySearch(JNDIRealm.java:1359)
    at org.apache.catalina.realm.JNDIRealm.getUser(JNDIRealm.java:1186)
    at org.apache.catalina.realm.JNDIRealm.getUser(JNDIRealm.java:1145)
    at org.apache.catalina.realm.JNDIRealm.authenticate(JNDIRealm.java:1087)
    at org.apache.catalina.realm.JNDIRealm.authenticate(JNDIRealm.java:945)
    at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:259)
    at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:449)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:394)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)
Caused by: javax.naming.CommunicationException: xxx.xxxxxx.xx:389 [Root
exception is java.net.SocketTimeoutException: connect timed out]
    at com.sun.jndi.ldap.LdapReferralContext.<init>(Unknown Source)
    at com.sun.jndi.ldap.LdapReferralException.getReferralContext(Unknown
Source)
    at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreReferrals(Unknown Source)
    ... 22 more
Caused by: java.net.SocketTimeoutException: connect timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.sun.jndi.ldap.Connection.createSocket(Unknown Source)
    at com.sun.jndi.ldap.Connection.<init>(Unknown Source)
    at com.sun.jndi.ldap.LdapClient.<init>(Unknown Source)
    at com.sun.jndi.ldap.LdapClient.getInstance(Unknown Source)
    at com.sun.jndi.ldap.LdapCtx.connect(Unknown Source)
    at com.sun.jndi.ldap.LdapCtx.<init>(Unknown Source)
    at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(Unknown Source)
    at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(Unknown Source)
    at com.sun.jndi.url.ldap.ldapURLContextFactory.getObjectInstance(Unknown
Source)
    at javax.naming.spi.NamingManager.getURLObject(Unknown Source)
    at javax.naming.spi.NamingManager.processURL(Unknown Source)
    at javax.naming.spi.NamingManager.processURLAddrs(Unknown Source)
    at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
    ... 25 more

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52636] JNDIRealm fails with CommunicationException and SocketTimeoutException

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52636

--- Comment #5 from Colin <co...@beeline-group.com> 2012-02-10 13:10:35 UTC ---
I´ll try the adCompat. Thanks for the feedback.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 52636] JNDIRealm fails with CommunicationException and SocketTimeoutException

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52636

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID

--- Comment #4 from Mark Thomas <ma...@apache.org> 2012-02-10 11:39:54 UTC ---
Looking at the stack trace you will see that referrals are being returned.
Failure to follow these is triggering the exceptions. As per the Tomcat docs,
you need to use adCompat.

Further questions on this topic belong on the users mailing list.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52636] JNDIRealm fails with CommunicationException and SocketTimeoutException

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52636

--- Comment #3 from Konstantin Kolinko <kn...@gmail.com> 2012-02-10 10:55:07 UTC ---
> our AD is serving 50+ servers fine without any timeouts and errors

Then maybe network between Tomcat and your AD is at fault?

> not handling a socket timeout

And how are you supposing to handle it here? A search is performed and it is
interrupted in a mid-flight. Try to write a patch.


Note that there is a way to ignore most PartialResultExceptions in JNDIRealm by
setting "adCompat" flag in the configuration, but it is likely not what you
want here.

Anyway, you have to discuss your problem on the users@ list first.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52636] JNDIRealm fails with CommunicationException and SocketTimeoutException

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52636

Colin <co...@beeline-group.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |colin.schaefer@beeline-grou
                   |                            |p.com

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52636] JNDIRealm fails with CommunicationException and SocketTimeoutException

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52636

Colin <co...@beeline-group.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |

--- Comment #2 from Colin <co...@beeline-group.com> 2012-02-10 10:24:29 UTC ---
Hi Konstantin,

our AD is serving 50+ servers fine without any timeouts and errors (before and
after the update). The tomcat is the only system throwing errors after the
update.

The configuration works fine, because after a restart of the tomcat, login is
possible for a short while obviously until the timeout occurs (as stated in the
other issues). As the logs state the "PartialNamingException" is not the root
exception, so there is no configuration error. The root Exceptions are
Communication and SocketTimeout.

I will not change the core timeouts and settings of my central directory
service for a single system not handling a socket timeout.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52636] JNDIRealm fails with CommunicationException and SocketTimeoutException

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52636

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Konstantin Kolinko <kn...@gmail.com> 2012-02-10 10:05:12 UTC ---
http://tomcat.apache.org/bugreport.html#Bugzilla_is_not_a_support_forum
Ask on the users@ list first.

I do not see any Tomcat errors here. It is just a timeout coming from your
ActiveDirectory server. Note that there is "PartialResultException" there.
Maybe you can reconfigure your ActiveDirectory server or the search clause used
by the realm, or can inspect the packets that are sent over network. The users
list is the place to discuss all that, not bugzilla.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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