You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Stéphane Chomat (travail)" <St...@imag.fr> on 2010/07/23 22:40:18 UTC

java.lang.ArrayIndexOutOfBoundsException on a already pojoization class

I call Pojoization in a builder eclipse with asm internaly (1.6.2)
I have this exception when I try to repass the pojoization on a already pojoization class. 
Pojoization tool have to call each time a class was build. 
It's an incremental builder.
I haven't to repass manipulation but I have to compute the metadata from annotation.

java.lang.ArrayIndexOutOfBoundsException: 8
at org.objectweb.asm.ClassReader.readUnsignedShort(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.apache.felix.ipojo.manipulator.Pojoization.computeAnnotations(Pojoization.java:292)
at org.apache.felix.ipojo.manipulator.Pojoization.manipulateComponents(Pojoization.java:484)
at org.apache.felix.ipojo.manipulator.Pojoization.manipulateDirectory(Pojoization.java:418)
at org.apache.felix.ipojo.manipulator.Pojoization.directoryPojoization(Pojoization.java:275)
at fr.imag.adele.cadse.builder.iPojo.IPojoBuilder.build(IPojoBuilder.java:73)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Stéphane CHOMAT

Equipe Adèle
Laboratoire d'Informatique de Grenoble
Bat. C, 220 rue de la Chimie, Domaine Universitaire
BP 53, 38041 Grenoble Cedex 9, France

Tel : +33 4 76 63 55 75 Fax : +33 4 76 63 55 50


Re: java.lang.ArrayIndexOutOfBoundsException on a already pojoization class

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

On 24.07.2010, at 09:20, Stéphane Chomat (travail) wrote:

> A patch can be this at the end of the method private byte[] getBytecode(final String classname) throws IOException
> This situation isn't normal but it's an possible error
> 
> if (in.length == 0)
>     throw new IOException("Empty class");

This is a possibility, but it might not be enough. Indeed, this just hide the exception thrown by ASM with this IOException.
I dont' have a good answer for now about this issue. Ignoring (writing a warning) when reading an empty class is a possibility,
however, this may not be the adequate behavior. 

What I don't really get, is why the compiler generates this empty class file. Is this a synchronization issue (the file is created, but the 
compilation is not yet done). If you have more details about that, we can probably find a good way to manage this case.

Regards,

Clement

> 
> Thanks
> Le 24 juil. 2010 à 09:10, Stéphane Chomat (travail) a écrit :
> 
>> When the byte array is empty !!! Why ?
>> 
>> Le 24 juil. 2010 à 08:27, Clement Escoffier a écrit :
>> 
>>> Hi,
>>> 
>>> I already saw this exception. The class under inspection is truncated. It generally happen in Eclipse when Eclipse compiler compiles the classes.
>>> I never really found the reason for that. The only turn around I found right now is to clean the project.
>>> 
>>> I will try to investigate deeper (the error is thrown by ASM, so it might be related to ASM too, so maybe updating ASM to 3.1 will fix it).
>>> 
>>> If you have a test case, that would help me a lot (outside of CADSE :-))
>>> 
>>> Regards,
>>> 
>>> Clement
>>> 
>>> 
>>> On 23.07.2010, at 22:40, Stéphane Chomat (travail) wrote:
>>> 
>>>> 
>>>> I call Pojoization in a builder eclipse with asm internaly (1.6.2)
>>>> I have this exception when I try to repass the pojoization on a already pojoization class. 
>>>> Pojoization tool have to call each time a class was build. 
>>>> It's an incremental builder.
>>>> I haven't to repass manipulation but I have to compute the metadata from annotation.
>>>> 
>>>> java.lang.ArrayIndexOutOfBoundsException: 8
>>>> at org.objectweb.asm.ClassReader.readUnsignedShort(Unknown Source)
>>>> at org.objectweb.asm.ClassReader.<init>(Unknown Source)
>>>> at org.objectweb.asm.ClassReader.<init>(Unknown Source)
>>>> at org.apache.felix.ipojo.manipulator.Pojoization.computeAnnotations(Pojoization.java:292)
>>>> at org.apache.felix.ipojo.manipulator.Pojoization.manipulateComponents(Pojoization.java:484)
>>>> at org.apache.felix.ipojo.manipulator.Pojoization.manipulateDirectory(Pojoization.java:418)
>>>> at org.apache.felix.ipojo.manipulator.Pojoization.directoryPojoization(Pojoization.java:275)
>>>> at fr.imag.adele.cadse.builder.iPojo.IPojoBuilder.build(IPojoBuilder.java:73)
>>>> at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
>>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>>>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
>>>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
>>>> at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
>>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>>>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
>>>> at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
>>>> at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
>>>> at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
>>>> at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
>>>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
>>>> 
>>>> Stéphane CHOMAT
>>>> 
>>>> Equipe Adèle
>>>> Laboratoire d'Informatique de Grenoble
>>>> Bat. C, 220 rue de la Chimie, Domaine Universitaire
>>>> BP 53, 38041 Grenoble Cedex 9, France
>>>> 
>>>> Tel : +33 4 76 63 55 75 Fax : +33 4 76 63 55 50
>>>> 
>>> 
>>> 
>> 
>> Stéphane CHOMAT
>> 
>> Equipe Adèle
>> Laboratoire d'Informatique de Grenoble
>> Bat. C, 220 rue de la Chimie, Domaine Universitaire
>> BP 53, 38041 Grenoble Cedex 9, France
>> 
>> Tel : +33 4 76 63 55 75 Fax : +33 4 76 63 55 50
>> 
> 
> Stéphane CHOMAT
> 
> Equipe Adèle
> Laboratoire d'Informatique de Grenoble
> Bat. C, 220 rue de la Chimie, Domaine Universitaire
> BP 53, 38041 Grenoble Cedex 9, France
> 
> Tel : +33 4 76 63 55 75 Fax : +33 4 76 63 55 50
> 


Re: java.lang.ArrayIndexOutOfBoundsException on a already pojoization class

Posted by "Stéphane Chomat (travail)" <st...@imag.fr>.
A patch can be this at the end of the method private byte[] getBytecode(final String classname) throws IOException
This situation isn't normal but it's an possible error

if (in.length == 0)
     throw new IOException("Empty class");

Thanks
Le 24 juil. 2010 à 09:10, Stéphane Chomat (travail) a écrit :

> When the byte array is empty !!! Why ?
> 
> Le 24 juil. 2010 à 08:27, Clement Escoffier a écrit :
> 
>> Hi,
>> 
>> I already saw this exception. The class under inspection is truncated. It generally happen in Eclipse when Eclipse compiler compiles the classes.
>> I never really found the reason for that. The only turn around I found right now is to clean the project.
>> 
>> I will try to investigate deeper (the error is thrown by ASM, so it might be related to ASM too, so maybe updating ASM to 3.1 will fix it).
>> 
>> If you have a test case, that would help me a lot (outside of CADSE :-))
>> 
>> Regards,
>> 
>> Clement
>> 
>> 
>> On 23.07.2010, at 22:40, Stéphane Chomat (travail) wrote:
>> 
>>> 
>>> I call Pojoization in a builder eclipse with asm internaly (1.6.2)
>>> I have this exception when I try to repass the pojoization on a already pojoization class. 
>>> Pojoization tool have to call each time a class was build. 
>>> It's an incremental builder.
>>> I haven't to repass manipulation but I have to compute the metadata from annotation.
>>> 
>>> java.lang.ArrayIndexOutOfBoundsException: 8
>>> at org.objectweb.asm.ClassReader.readUnsignedShort(Unknown Source)
>>> at org.objectweb.asm.ClassReader.<init>(Unknown Source)
>>> at org.objectweb.asm.ClassReader.<init>(Unknown Source)
>>> at org.apache.felix.ipojo.manipulator.Pojoization.computeAnnotations(Pojoization.java:292)
>>> at org.apache.felix.ipojo.manipulator.Pojoization.manipulateComponents(Pojoization.java:484)
>>> at org.apache.felix.ipojo.manipulator.Pojoization.manipulateDirectory(Pojoization.java:418)
>>> at org.apache.felix.ipojo.manipulator.Pojoization.directoryPojoization(Pojoization.java:275)
>>> at fr.imag.adele.cadse.builder.iPojo.IPojoBuilder.build(IPojoBuilder.java:73)
>>> at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
>>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
>>> at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
>>> at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
>>> at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
>>> at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
>>> at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
>>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
>>> 
>>> Stéphane CHOMAT
>>> 
>>> Equipe Adèle
>>> Laboratoire d'Informatique de Grenoble
>>> Bat. C, 220 rue de la Chimie, Domaine Universitaire
>>> BP 53, 38041 Grenoble Cedex 9, France
>>> 
>>> Tel : +33 4 76 63 55 75 Fax : +33 4 76 63 55 50
>>> 
>> 
>> 
> 
> Stéphane CHOMAT
> 
> Equipe Adèle
> Laboratoire d'Informatique de Grenoble
> Bat. C, 220 rue de la Chimie, Domaine Universitaire
> BP 53, 38041 Grenoble Cedex 9, France
> 
> Tel : +33 4 76 63 55 75 Fax : +33 4 76 63 55 50
> 

Stéphane CHOMAT

Equipe Adèle
Laboratoire d'Informatique de Grenoble
Bat. C, 220 rue de la Chimie, Domaine Universitaire
BP 53, 38041 Grenoble Cedex 9, France

Tel : +33 4 76 63 55 75 Fax : +33 4 76 63 55 50


Re: java.lang.ArrayIndexOutOfBoundsException on a already pojoization class

Posted by "Stéphane Chomat (travail)" <st...@imag.fr>.
When the byte array is empty !!! Why ?

Le 24 juil. 2010 à 08:27, Clement Escoffier a écrit :

> Hi,
> 
> I already saw this exception. The class under inspection is truncated. It generally happen in Eclipse when Eclipse compiler compiles the classes.
> I never really found the reason for that. The only turn around I found right now is to clean the project.
> 
> I will try to investigate deeper (the error is thrown by ASM, so it might be related to ASM too, so maybe updating ASM to 3.1 will fix it).
> 
> If you have a test case, that would help me a lot (outside of CADSE :-))
> 
> Regards,
> 
> Clement
> 
> 
> On 23.07.2010, at 22:40, Stéphane Chomat (travail) wrote:
> 
>> 
>> I call Pojoization in a builder eclipse with asm internaly (1.6.2)
>> I have this exception when I try to repass the pojoization on a already pojoization class. 
>> Pojoization tool have to call each time a class was build. 
>> It's an incremental builder.
>> I haven't to repass manipulation but I have to compute the metadata from annotation.
>> 
>> java.lang.ArrayIndexOutOfBoundsException: 8
>> at org.objectweb.asm.ClassReader.readUnsignedShort(Unknown Source)
>> at org.objectweb.asm.ClassReader.<init>(Unknown Source)
>> at org.objectweb.asm.ClassReader.<init>(Unknown Source)
>> at org.apache.felix.ipojo.manipulator.Pojoization.computeAnnotations(Pojoization.java:292)
>> at org.apache.felix.ipojo.manipulator.Pojoization.manipulateComponents(Pojoization.java:484)
>> at org.apache.felix.ipojo.manipulator.Pojoization.manipulateDirectory(Pojoization.java:418)
>> at org.apache.felix.ipojo.manipulator.Pojoization.directoryPojoization(Pojoization.java:275)
>> at fr.imag.adele.cadse.builder.iPojo.IPojoBuilder.build(IPojoBuilder.java:73)
>> at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
>> at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
>> at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
>> at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
>> at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
>> at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
>> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
>> 
>> Stéphane CHOMAT
>> 
>> Equipe Adèle
>> Laboratoire d'Informatique de Grenoble
>> Bat. C, 220 rue de la Chimie, Domaine Universitaire
>> BP 53, 38041 Grenoble Cedex 9, France
>> 
>> Tel : +33 4 76 63 55 75 Fax : +33 4 76 63 55 50
>> 
> 
> 

Stéphane CHOMAT

Equipe Adèle
Laboratoire d'Informatique de Grenoble
Bat. C, 220 rue de la Chimie, Domaine Universitaire
BP 53, 38041 Grenoble Cedex 9, France

Tel : +33 4 76 63 55 75 Fax : +33 4 76 63 55 50


Re: java.lang.ArrayIndexOutOfBoundsException on a already pojoization class

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

I already saw this exception. The class under inspection is truncated. It generally happen in Eclipse when Eclipse compiler compiles the classes.
I never really found the reason for that. The only turn around I found right now is to clean the project.

I will try to investigate deeper (the error is thrown by ASM, so it might be related to ASM too, so maybe updating ASM to 3.1 will fix it).

If you have a test case, that would help me a lot (outside of CADSE :-))

Regards,

Clement


On 23.07.2010, at 22:40, Stéphane Chomat (travail) wrote:

> 
> I call Pojoization in a builder eclipse with asm internaly (1.6.2)
> I have this exception when I try to repass the pojoization on a already pojoization class. 
> Pojoization tool have to call each time a class was build. 
> It's an incremental builder.
> I haven't to repass manipulation but I have to compute the metadata from annotation.
> 
> java.lang.ArrayIndexOutOfBoundsException: 8
> at org.objectweb.asm.ClassReader.readUnsignedShort(Unknown Source)
> at org.objectweb.asm.ClassReader.<init>(Unknown Source)
> at org.objectweb.asm.ClassReader.<init>(Unknown Source)
> at org.apache.felix.ipojo.manipulator.Pojoization.computeAnnotations(Pojoization.java:292)
> at org.apache.felix.ipojo.manipulator.Pojoization.manipulateComponents(Pojoization.java:484)
> at org.apache.felix.ipojo.manipulator.Pojoization.manipulateDirectory(Pojoization.java:418)
> at org.apache.felix.ipojo.manipulator.Pojoization.directoryPojoization(Pojoization.java:275)
> at fr.imag.adele.cadse.builder.iPojo.IPojoBuilder.build(IPojoBuilder.java:73)
> at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
> at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
> at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
> at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
> at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
> at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
> 
> Stéphane CHOMAT
> 
> Equipe Adèle
> Laboratoire d'Informatique de Grenoble
> Bat. C, 220 rue de la Chimie, Domaine Universitaire
> BP 53, 38041 Grenoble Cedex 9, France
> 
> Tel : +33 4 76 63 55 75 Fax : +33 4 76 63 55 50
>