directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@apache.org>
Subject Re: [jira] Commented: (DIRSERVER-970) Hot Partition Fails With ArrayIndexOutOfBoundsException
Date Fri, 15 Jun 2007 21:08:31 GMT
Ole Ersoy a écrit :

> Emmanuel,
>
> I know - It totally seems like I just need to switch to a more recent 
> version.  This one really tricked me up, because first I cleared out 
> my Maven Repository.  Then rebuilt ADS again.  Then tested the 
> archetype classes.  The tests run fine.  So finally I'm ready to get 
> back to work on the DAS.  I copy the Embedded test classes over to 
> that project, run them, and get the exception.  #%^$#$$^$.  So I 
> thought maybe there was something weird going on with the project 
> setup.  So I clean out the maven repository again, rebuild ADS again, 
> create a brand new project, copy the archetype test packages over to 
> the new project, run the tests...voila...same exception.  So finally I 
> remembered that I needed to copy the logging properties over as well.  
> Then everything runs smooth.

This is because you run it in WARN mode, when we don't call the 
toString() method.

>
>
> OK - I have everything running fine.  Here's what I'm going to do.  
> I'll rename the logging properties file and run the test again.  Here 
> is the stack trace:
>
> java.lang.ArrayIndexOutOfBoundsException: 0
>     at 
> org.apache.directory.shared.ldap.schema.AbstractSchemaObject.toString(AbstractSchemaObject.java:320)

>

This has been fixed. Really. The 
java.lang.ArrayIndexOutOfBoundsException was due to a bad access to an 
empty ArrayList, and the toString method is now doing :

if ( ( name == null ) || ( name.size() == 0 ) ) then print "null" else 
print name [0]

There is no case this can cause a AIOOBE. You can look at the code, 
there is no magic in it

>
> Strange right?

Yes, strange. Now, my guess : in your pom.xml, you are refering an old 
version of this jar, or refering another jar which refers this old version.

What you can do is to setup a BP on the faultive method, and debug the 
code to see what happens...

Emmanuel


Mime
View raw message