You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Alex Karasulu (JIRA)" <ji...@apache.org> on 2006/02/21 05:00:27 UTC
[jira] Commented: (DIRSERVER-584) LdapName breaks static parser
after repeated use.
[ http://issues.apache.org/jira/browse/DIRSERVER-584?page=comments#action_12367132 ]
Alex Karasulu commented on DIRSERVER-584:
-----------------------------------------
Ok this is part II:
I have found a way to reproduce the error in eclipse. Looks like running org.apache.directory.server.jndi.ServerContextFactoryTest before running org.apache.directory.server.AddObjectClassesToEntryTest makes the parser fail. This parser is a reused static parser by the LdapName class. I think something is going stale in the parser after the first tests are run.
Try deleting the other tests minus these two in server-main module. Then run these two tests together in elcipse using the run option for all tests in the project. Then you can reproduce the error within eclipse.
I am debugging now and for some reason the parser starts to see the first token "ou" in the case of the "ou=system" string as a WS token of type = 16. This is a whitespace token. I think deep down the lexer is messed up somewhere. I'll try to isolate what is making the lexer freak.
Alex
> LdapName breaks static parser after repeated use.
> -------------------------------------------------
>
> Key: DIRSERVER-584
> URL: http://issues.apache.org/jira/browse/DIRSERVER-584
> Project: Directory ApacheDS
> Type: Bug
> Components: ldap
> Versions: 1.0-RC1
> Reporter: Alex Karasulu
> Priority: Blocker
> Fix For: 1.0-RC1
>
> 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
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira