Issue Details (XML | Word | Printable)

Key: DIRSERVER-584
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Unassigned
Reporter: Alex Karasulu
Votes: 0
Watchers: 0
Operations

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

LdapName breaks static parser after repeated use.

Created: 21/Feb/06 12:58 PM   Updated: 21/Feb/06 10:29 PM
Return to search
Component/s: ldap
Affects Version/s: 1.0-RC1
Fix Version/s: 1.0-RC1

Time Tracking:
Not Specified

Resolution Date: 21/Feb/06 02:14 PM


 Description  « Hide
I'm thinking some of the recent changes on the name parser may have introduced new problems.

These are really weird problems. They happen only when running regression tests in maven within the server-unit module. Yeah crazy. Basically to reproduce run "mvn -Dregression test" inside the apacheds/server-main module. These are the tests that fail:

$ mvn -Dregressions test
[INFO] ----------------------------------------------------------------------------
[INFO] Building ApacheDS Server Unit
....
T E S T S
-------------------------------------------------------
....
[surefire] Running org.apache.directory.server.AddObjectClassesToEntryTest
[surefire] Tests run: 3, Failures: 0, Errors: 3, Time elapsed: 0.113 sec <<<<<<<< FAILURE !!
[surefire] Running org.apache.directory.server.MiscTest
[surefire] Tests run: 7, Failures: 0, Errors: 7, Time elapsed: 0.177 sec <<<<<<<< FAILURE !!
[surefire] Running org.apache.directory.server.MatchingRuleCompareTest
[surefire] Tests run: 3, Failures: 0, Errors: 3, Time elapsed: 0.08 sec <<<<<<<< FAILURE !!

Now when these tests run inside eclipse there is no problem. Here's what teh surefire report
looks like for these failures. They are all pretty much the same trace:
========================================================================================================
o.a.d.shared.ldap.exception.LdapConfigurationException: Failed to normalize the suffix: ou=system
[Root exception is o.a.d.shared.ldap.exception.LdapInvalidNameException: Parser failure on name:
       ou=system
Antlr exception trace:
line 1:1: unexpected token: ou
       at o.a.d.shared.ldap.name.antlrNameParser.attributeTypeAndValue(antlrNameParser.java:192)
       at o.a.d.shared.ldap.name.antlrNameParser.nameComponent(antlrNameParser.java:120)
       at o.a.d.shared.ldap.name.antlrNameParser.name(antlrNameParser.java:69)
       at o.a.d.shared.ldap.name.DnParser.parse(DnParser.java:208)
       at o.a.d.shared.ldap.name.LdapName.<init>(LdapName.java:115)
       at o.a.d.server.core.configuration.DirectoryPartitionConfiguration.setSuffix(DirectoryPartitionConfiguration.java:203)
========================================================================================================

The suspect code is at o.a.d.server.core.configuration.DirectoryPartitionConfiguration.setSuffix(DirectoryPartitionConfiguration.java:203:

   /**
    * Sets the suffix of the {@link DirectoryPartition}.
    */
   protected void setSuffix( String suffix ) throws NamingException
   {
       suffix = suffix.trim();
       try
202: {
203: new LdapName( suffix ); <<<<<<<<================== HERE!!!
204: }
       catch ( NamingException e )
       {
           throw new LdapConfigurationException( "Failed to normalize the suffix: " + suffix, e );
       }
       this.suffix = suffix;
   }

This is crazy though because how the heck is the parser failing on "ou=system" and succeeding on all test cases I cannot understand. I think I'm loosing my mind on this one this is why I need a second opinion. Please advise.

Thanks,
Alex


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #379345 Tue Feb 21 05:09:38 UTC 2006 akarasulu fix for DIRSERVER-584 which reinitializes the parser after exceptions are encountered
Files Changed
MODIFY /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnParser.java