Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » ClassFormatError
ClassFormatError [message #56104] Mon, 29 August 2005 16:26 Go to next message
Eclipse UserFriend
Originally posted by: schulz78.gmx.net

I am using AJDT 1.3 (20050729161227) with Eclipse 3.1 in a multiproject
setup. One plugin defines aspects that are woven into the class files
produced when compiling other plugins. The projects are linked via the
aspectpath option. Classes within the aspect-defining plugin are woven
correctly. However, when the aspects are applied to the classes of
another plugin things go wrong. When I start up my application the VM
moans about classes with duplicate interfaces (ClassFormatError).
Decompiling my classes with JAD unveils that in fact classes are defined
to implement one and the same interface twice. Furthermore fields are
generated twice, which would produce an error too, if the verification
wouldn't stumble across the duplicate interface. I guess that the class
is woven twice, but I don't know why? It might be a bug, too! I'm using
annotation style aspects.

Here is a woven decompiled sample class:

Original:
---------

@Managed
public class Test {

public Test() {
}

}

Woven (decompiled):
-------------------

public class Test
implements de.cohesion.lmf.ManagementAspect.ajcMightHaveAspect,
de.cohesion.lmf.ManagementAspect.ajcMightHaveAspect
{

public Test()
{
JoinPoint joinpoint = Factory.makeJP(ajc$tjp_0, this, this);
ManagementAspect.ajc$perObjectBind(this);
init$_aroundBody1$advice(this, joinpoint,
CallstackAspect.aspectOf(), this, null, joinpoint);
}

public ManagementAspect
ajc$de_cohesion_lmf_ManagementAspect$perObjectGet()
{
return ajc$de_cohesion_lmf_ManagementAspect$perObjectField;
}

public void
ajc$de_cohesion_lmf_ManagementAspect$perObjectSet(Management Aspect
managementaspect)
{
ajc$de_cohesion_lmf_ManagementAspect$perObjectField =
managementaspect;
}

private static final void init$_aroundBody0(Test test, JoinPoint
joinpoint)
{
if(ManagementAspect.hasAspect(test))

ManagementAspect.aspectOf(test).ajc$before$de_cohesion_lmf_M anagementAspect$1$2e8d3d(test);
}

private static final Object
init$_aroundBody1$advice(CallstackAspect this, Object o, AroundClosure
ajc_aroundClosure, JoinPoint thisJoinPoint, Stack stack, JoinPoint
joinpoint)
{
Stack stack1;
stack1 =
(Stack)CallstackAspect.ajc$inlineAccessFieldGet$de_cohesion_ lmf_trace_CallstackAspect$de_cohesion_lmf_trace_CallstackAsp ect$stacks(ajc_aroundClosure).get();
stack1.push(new Invocation(thisJoinPoint,
JoinPoints.getConstructor(joinpoint), joinpoint.getArgs()));
Object obj;
Stack stack2 = stack;
JoinPoint joinpoint1 = thisJoinPoint;
init$_aroundBody0((Test)joinpoint1, ((JoinPoint) (o)));
obj = null;
stack1.pop();
return obj;
Exception exception;
exception;
stack1.pop();
throw exception;
}

public ManagementAspect
ajc$de_cohesion_lmf_ManagementAspect$perObjectGet()
{
return ajc$de_cohesion_lmf_ManagementAspect$perObjectField;
}

public void
ajc$de_cohesion_lmf_ManagementAspect$perObjectSet(Management Aspect
managementaspect)
{
ajc$de_cohesion_lmf_ManagementAspect$perObjectField =
managementaspect;
}

private transient ManagementAspect
ajc$de_cohesion_lmf_ManagementAspect$perObjectField;
private static final org.aspectj.lang.JoinPoint.StaticPart ajc$tjp_0;
private transient ManagementAspect
ajc$de_cohesion_lmf_ManagementAspect$perObjectField;

static
{
Factory factory = new Factory("Test.java",
Class.forName("de.cohesion.test.Test"));
ajc$tjp_0 = factory.makeSJP("constructor-execution",
factory.makeConstructorSig("1--de.cohesion.test.Test----"), 31);
}
}
Re: ClassFormatError [message #56132 is a reply to message #56104] Tue, 30 August 2005 16:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adrian_colyer.uk.ibm.com

Sven Schulz wrote:
> I am using AJDT 1.3 (20050729161227) with Eclipse 3.1 in a multiproject
> setup. One plugin defines aspects that are woven into the class files
> produced when compiling other plugins. The projects are linked via the
> aspectpath option. Classes within the aspect-defining plugin are woven
> correctly. However, when the aspects are applied to the classes of
> another plugin things go wrong. When I start up my application the VM
> moans about classes with duplicate interfaces (ClassFormatError).
> Decompiling my classes with JAD unveils that in fact classes are defined
> to implement one and the same interface twice. Furthermore fields are
> generated twice, which would produce an error too, if the verification
> wouldn't stumble across the duplicate interface. I guess that the class
> is woven twice, but I don't know why? It might be a bug, too! I'm using
> annotation style aspects.
>

I'm suspicious of some kind of incremental compilation bug here. Do
things get better if you do a "clean" of the workspace (project menu)?
Regardless, this is definitely a bug of some kind so please raise a
bugzilla report. Anything you can do to narrow down the set of
circumstances needed to reproduce the bug would be much appreciated.

Thanks, Adrian.
Re: ClassFormatError [message #56301 is a reply to message #56132] Tue, 30 August 2005 18:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: schulz78.gmx.net

Adrian Colyer wrote:
> Sven Schulz wrote:
>
>> I am using AJDT 1.3 (20050729161227) with Eclipse 3.1 in a
>> multiproject setup. One plugin defines aspects that are woven into the
>> class files produced when compiling other plugins. The projects are
>> linked via the aspectpath option. Classes within the aspect-defining
>> plugin are woven correctly. However, when the aspects are applied to
>> the classes of another plugin things go wrong. When I start up my
>> application the VM moans about classes with duplicate interfaces
>> (ClassFormatError). Decompiling my classes with JAD unveils that in
>> fact classes are defined to implement one and the same interface
>> twice. Furthermore fields are generated twice, which would produce an
>> error too, if the verification wouldn't stumble across the duplicate
>> interface. I guess that the class is woven twice, but I don't know
>> why? It might be a bug, too! I'm using annotation style aspects.
>>
>
> I'm suspicious of some kind of incremental compilation bug here. Do
> things get better if you do a "clean" of the workspace (project menu)?
> Regardless, this is definitely a bug of some kind so please raise a
> bugzilla report. Anything you can do to narrow down the set of
> circumstances needed to reproduce the bug would be much appreciated.
>
> Thanks, Adrian.

Hi Adrian,

doing a clean rebuild is of no success. Even deactivating incremental
compilation does not change anything. Currently I have no spare time to
raise a bug or even narrow done the context.

However, for all of those experiencing the same problem, there's a
workaround. Just use the inpath feature instead of the aspectpath.

By the way, changing to a up-to-date developer build is of no help
either, since then compilation fails at all, stating some problem with
undeclared in a generic class. No clue, what the hell is causing this.

Thanks, Sven
Re: ClassFormatError [message #56361 is a reply to message #56301] Wed, 31 August 2005 19:02 Go to previous message
Eclipse UserFriend
Originally posted by: adrian_colyer.uk.ibm.com

Sven Schulz wrote:

> By the way, changing to a up-to-date developer build is of no help
> either, since then compilation fails at all, stating some problem with
> undeclared in a generic class. No clue, what the hell is causing this.
>
> Thanks, Sven

I fixed a couple of bugs raised in the last few days that were causing
messages about "undeclared type variables" when trying to parse the
generic signature of generic and parameterized types, so hopefully that
error you saw will be fixed in the latest builds of AspectJ. I'll keep
my eye out for any problem like the one you were seeing before and run
some basic tests to try and reproduce it. If you do ever get the chance
to narrow it down any, just jot the details down in a bug report please.

Thanks, Adrian.
Re: ClassFormatError [message #589926 is a reply to message #56104] Tue, 30 August 2005 16:22 Go to previous message
Adrian Colyer is currently offline Adrian ColyerFriend
Messages: 61
Registered: July 2009
Member
Sven Schulz wrote:
> I am using AJDT 1.3 (20050729161227) with Eclipse 3.1 in a multiproject
> setup. One plugin defines aspects that are woven into the class files
> produced when compiling other plugins. The projects are linked via the
> aspectpath option. Classes within the aspect-defining plugin are woven
> correctly. However, when the aspects are applied to the classes of
> another plugin things go wrong. When I start up my application the VM
> moans about classes with duplicate interfaces (ClassFormatError).
> Decompiling my classes with JAD unveils that in fact classes are defined
> to implement one and the same interface twice. Furthermore fields are
> generated twice, which would produce an error too, if the verification
> wouldn't stumble across the duplicate interface. I guess that the class
> is woven twice, but I don't know why? It might be a bug, too! I'm using
> annotation style aspects.
>

I'm suspicious of some kind of incremental compilation bug here. Do
things get better if you do a "clean" of the workspace (project menu)?
Regardless, this is definitely a bug of some kind so please raise a
bugzilla report. Anything you can do to narrow down the set of
circumstances needed to reproduce the bug would be much appreciated.

Thanks, Adrian.
Re: ClassFormatError [message #589945 is a reply to message #56132] Tue, 30 August 2005 18:47 Go to previous message
Eclipse UserFriend
Originally posted by: schulz78.gmx.net

Adrian Colyer wrote:
> Sven Schulz wrote:
>
>> I am using AJDT 1.3 (20050729161227) with Eclipse 3.1 in a
>> multiproject setup. One plugin defines aspects that are woven into the
>> class files produced when compiling other plugins. The projects are
>> linked via the aspectpath option. Classes within the aspect-defining
>> plugin are woven correctly. However, when the aspects are applied to
>> the classes of another plugin things go wrong. When I start up my
>> application the VM moans about classes with duplicate interfaces
>> (ClassFormatError). Decompiling my classes with JAD unveils that in
>> fact classes are defined to implement one and the same interface
>> twice. Furthermore fields are generated twice, which would produce an
>> error too, if the verification wouldn't stumble across the duplicate
>> interface. I guess that the class is woven twice, but I don't know
>> why? It might be a bug, too! I'm using annotation style aspects.
>>
>
> I'm suspicious of some kind of incremental compilation bug here. Do
> things get better if you do a "clean" of the workspace (project menu)?
> Regardless, this is definitely a bug of some kind so please raise a
> bugzilla report. Anything you can do to narrow down the set of
> circumstances needed to reproduce the bug would be much appreciated.
>
> Thanks, Adrian.

Hi Adrian,

doing a clean rebuild is of no success. Even deactivating incremental
compilation does not change anything. Currently I have no spare time to
raise a bug or even narrow done the context.

However, for all of those experiencing the same problem, there's a
workaround. Just use the inpath feature instead of the aspectpath.

By the way, changing to a up-to-date developer build is of no help
either, since then compilation fails at all, stating some problem with
undeclared in a generic class. No clue, what the hell is causing this.

Thanks, Sven
Re: ClassFormatError [message #589975 is a reply to message #56301] Wed, 31 August 2005 19:02 Go to previous message
Adrian Colyer is currently offline Adrian ColyerFriend
Messages: 61
Registered: July 2009
Member
Sven Schulz wrote:

> By the way, changing to a up-to-date developer build is of no help
> either, since then compilation fails at all, stating some problem with
> undeclared in a generic class. No clue, what the hell is causing this.
>
> Thanks, Sven

I fixed a couple of bugs raised in the last few days that were causing
messages about "undeclared type variables" when trying to parse the
generic signature of generic and parameterized types, so hopefully that
error you saw will be fixed in the latest builds of AspectJ. I'll keep
my eye out for any problem like the one you were seeing before and run
some basic tests to try and reproduce it. If you do ever get the chance
to narrow it down any, just jot the details down in a bug report please.

Thanks, Adrian.
Previous Topic:Adding an interace to class based on it implementing a interface.
Next Topic:Adding an interace to class based on it implementing a interface.
Goto Forum:
  


Current Time: Fri Apr 26 22:56:00 GMT 2024

Powered by FUDForum. Page generated in 0.03176 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top