United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6207824 : JNDI sending premature ABANDON after connection has closed

Details
Type:
Bug
Submit Date:
2004-12-13
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2005-10-08
Component:
core-libs
OS:
windows_xp
Sub-Component:
javax.naming
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.4.2_06
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
Cu is running Java 1.4.2_xx and is having problems with JNDI connecting to Directory Proxy for certain authentication requests. I have reproduced this problem on Windows and Solaris with Sun 1.4.2 VM and OS X with Apple 1.4.2 VM.

We have a testcase and it is available at:

http://lonestar.red.iplanet.com/~maraja/images/cases/testGPLDLogin.java

javax.naming.CommunicationException: Request: 1 cancelled

The error we SHOULD receive is:

Caught exception at initializing Ldap. javax.naming.AuthenticationException: [LDAP: error code 49 - password expired!]

We see this error when we have the following setup:

Java JNDI --> Directory Proxy --> Directory

Here are the steps to reproduce the problem:

(1)

Run testGPLDLogin.class with the following:

java testGPLDLogin 032test 032test

This should produce:

Caught exception at initializing Ldap. javax.naming.AuthenticationException: [LDAP: error code 49 - password expired!]

That is expected.

(2)

If log level is low (notice) on the Directory Proxy Server and the Directory Proxy Server is configured to disallow anonymous connections, occasionally, you will see the following:

javax.naming.CommunicationException: Request: 1cancelled

When this occurs, the application exits unexpectedly.
###@###.### 2004-12-13 20:34:11 GMT

                                    

Comments
SUGGESTED FIX

Jaya Hangal wrote:
> The fix is in the LdapRequest.getReplyBer() method by adding another
> state to the LdapRequest that indicates whether the request was 
> cancelled by the cleanup when the Connection thread exits. When this 
> happens, LdapRequest.getReplyBer() method goes ahead and reads the reply 
> instead of throwing the Communication exception. The Connection thread 
> exits. The LdapClient thread exits only after processing the reply if 
> there is any.
> 
> The idea behind the fix is to prevent the LdapClient from bailing out
> without processing the outstanding reply from the server
> when the connection is being closed by the Connection thread. I believe
> this fix doesn't have side effects on any other operation.
###@###.### 2005-04-27 01:54:56 GMT
                                     
2005-03-02
EVALUATION

There is a race around access to cancel() between the Connection thread
and the LdapClient thread.
###@###.### 2005-04-27 01:54:57 GMT
                                     
2005-04-27



Hardware and Software, Engineered to Work Together