Issue Details (XML | Word | Printable)

Key: DIRSERVER-245
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alex Karasulu
Reporter: Trustin Lee
Votes: 2
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

DnParser throws IOException in Java 5

Created: 21/Dec/04 06:54 AM   Updated: 09/Jul/08 01:39 PM
Return to search
Component/s: ldap
Affects Version/s: pre-1.0
Fix Version/s: pre-1.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File random search bug.txt 2005-05-18 07:38 AM elliot schlegelmilch 6 kB
Text File Licensed for inclusion in ASF works ReusableAntlrStuffForDnParser.patch 2005-08-29 06:36 AM Ersin Er 13 kB
Environment: Sun Java 5 VM in client mode

Resolution Date: 29/Aug/05 10:16 AM


 Description  « Hide
I tested with Kerberos single jar server. It works fine in JDK 1.4.2, but it doesn't work in JDK 1.5.0. Here is the output:

C:\Documents and Settings\Trustin Lee\My Documents\workspace\kerberos\main>java
-jar target\kerberos-0.4-SNAPSHOT.jar kerberos.properties
Apache Kerberos: started in 861 milliseconds
Entry ou=Users, dc=example, dc=com from LDIF does not exist. Creating it ...
Entry uid=akarasulu, ou=Users, dc=example,dc=com from LDIF does not exist. Crea
ting it ...
Entry uid=erodriguez, ou=Users, dc=example,dc=com from LDIF does not exist. Cre
ating it ...
org.apache.ldap.common.exception.LdapNamingException: Parser failure on name:
        dc=example,dc=com
Antlr exception trace:
java.io.IOException: Read end dead
        at java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:1
92)
        at java.io.PipedInputStream.receive(PipedInputStream.java:156)
        at java.io.PipedOutputStream.write(PipedOutputStream.java:129)
        at java.io.OutputStream.write(OutputStream.java:58)
        at org.apache.ldap.common.name.DnParser.parse(DnParser.java:166)
        at org.apache.ldap.common.name.LdapName.<init>(LdapName.java:284)
        at org.apache.eve.jndi.EveContext.<init>(EveContext.java:102)
        at org.apache.eve.jndi.EveDirContext.<init>(EveDirContext.java:72)
        at org.apache.eve.jndi.EveLdapContext.<init>(EveLdapContext.java:58)
        at org.apache.eve.jndi.EveJndiProvider.getLdapContext(EveJndiProvider.ja
va:125)
        at org.apache.eve.jndi.EveContextFactory.getInitialContext(EveContextFac
tory.java:190)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
67)
        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.jav
a:82)
        at org.apache.kerberos.KerberosMain.main(KerberosMain.java:143)

        at org.apache.ldap.common.name.DnParser.parse(DnParser.java:195)
        at org.apache.ldap.common.name.LdapName.<init>(LdapName.java:284)
        at org.apache.eve.jndi.EveContext.<init>(EveContext.java:102)
        at org.apache.eve.jndi.EveDirContext.<init>(EveDirContext.java:72)
        at org.apache.eve.jndi.EveLdapContext.<init>(EveLdapContext.java:58)
        at org.apache.eve.jndi.EveJndiProvider.getLdapContext(EveJndiProvider.ja
va:125)
        at org.apache.eve.jndi.EveContextFactory.getInitialContext(EveContextFac
tory.java:190)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
67)
        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.jav
a:82)
        at org.apache.kerberos.KerberosMain.main(KerberosMain.java:143)
Exception in thread "main" java.lang.IllegalArgumentException: first argument wa
s not a distinguished name
        at org.apache.ldap.common.schema.DnComparator.compare(DnComparator.java:
97)
        at org.apache.eve.schema.SerializableComparator.compare(SerializableComp
arator.java:92)
        at jdbm.btree.BPage.compare(BPage.java:841)
        at jdbm.btree.BPage.findChildren(BPage.java:682)
        at jdbm.btree.BPage.find(BPage.java:269)
        at jdbm.btree.BTree.find(BTree.java:406)
        at org.apache.eve.db.jdbm.JdbmTable.getRaw(JdbmTable.java:1102)
        at org.apache.eve.db.jdbm.JdbmTable.get(JdbmTable.java:283)
        at org.apache.eve.db.jdbm.JdbmIndex.forwardLookup(JdbmIndex.java:216)
        at org.apache.eve.db.jdbm.JdbmDatabase.getEntryId(JdbmDatabase.java:418)

        at org.apache.eve.AbstractContextPartition.lookup(AbstractContextPartiti
on.java:315)
        at org.apache.eve.RootNexus.lookup(RootNexus.java:350)
        at org.apache.eve.jndi.AuthenticationService.doAuthSimple(Authentication
Service.java:172)
        at org.apache.eve.jndi.AuthenticationService.invoke(AuthenticationServic
e.java:99)
        at org.apache.eve.jndi.FailFastPipeline.invoke(FailFastPipeline.java:62)

        at org.apache.eve.jndi.EveJndiProvider.invoke(EveJndiProvider.java:180)
        at $Proxy0.hasEntry(Unknown Source)
        at org.apache.eve.jndi.EveContext.<init>(EveContext.java:103)
        at org.apache.eve.jndi.EveDirContext.<init>(EveDirContext.java:72)
        at org.apache.eve.jndi.EveLdapContext.<init>(EveLdapContext.java:58)
        at org.apache.eve.jndi.EveJndiProvider.getLdapContext(EveJndiProvider.ja
va:125)
        at org.apache.eve.jndi.EveContextFactory.getInitialContext(EveContextFac
tory.java:190)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
67)
        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.jav
a:82)
        at org.apache.kerberos.KerberosMain.main(KerberosMain.java:143)

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
elliot schlegelmilch added a comment - 18/May/05 07:38 AM
I too get this error, however under different circumstances. When the server is idle for an amount of time (5-10 minutes) the first search gives the attached stack trace. I noticed revision ( http://svn.apache.org/viewcvs.cgi?diff_format=h&rev=56905&view=rev ), but this doesn't quite solve the problem.

Alex Karasulu added a comment - 12/Aug/05 04:31 AM
Is this still the case Trustin?

Trustin Lee added a comment - 12/Aug/05 12:12 PM
Yes, we need to fix it. :)


Alex Karasulu added a comment - 29/Aug/05 02:06 AM
Ersin feel free to modify the piped implementation to use the better technique you have discovered. I will gladly accept the patch. Thanks,

Ersin Er added a comment - 29/Aug/05 06:35 AM
I replaced the current Piped..Stream plumbing stuff with a solution I implemented for Subtree Specification parser. Now all tests (under Ldap Common) pass with both JRE 1.4.2 and JRE 5.0.

Changes with this patch includes:

 - DnParser has been completely refactored for new plumbing mechanism.
 - Added three classes extending current antlr generated parser and lexers which provides some fuctionality to reset state.

It took some longer than I expected because of the selector stuff but it seems ok now.

Alex Karasulu added a comment - 29/Aug/05 10:16 AM
Another solid patch. I'm having trouble keeping up with you Ersin :-).

I have applied it and committed on revision 263982 here:

http://svn.apache.org/viewcvs.cgi?rev=263982&view=rev