Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] badWeaverState exception on iajc w/out prior clean

Hello,

Thanks again for helping me out. I decided to go back to the drawing
board and created a very stripped down project (one class that does next
to nothing, a JUnit test for it, and an aspect used in the test). Please
see the attached zip for the source and build.xml. In the
compile-tests-with-aspects target, I call the iajc task with nothing for
the classpath other than JUnit, aspectjrt.jar, and my classes. The
inpath is just my classes and test.

(BTW, Wes...if I remove the destination dir from my inpath, those
classes won't get woven, right? I do want them to be...)

When I ant clean, then compile-tests-with-aspects multiple times even
without making any changes to the source in between, the first two
compiles run successfully, but every subsequent compile gives me the bad
WeaverState exception. I've also attached the trace of the output.

I really appreciate all the help and hope there's a simple solution to
this problem :)

diane


-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Wes Isberg
Sent: Saturday, February 25, 2006 12:55 AM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] badWeaverState exception on iajc w/out
prior clean

Hi Diane -

re: "bad WeaverState.Kind: -115", kind 115 means
- extended
  - reweavable
    - compressed
    - diff
and should be understood by the 1.5.0 weaver.
Ron might be suggesting that the first build is with a recent weaver
(produces kind 115), and the second with an older one (unable to
understand kind 115).

Based on the original ant task you submitted, I'd suggest removing the
destination directory from the inpath and adding forkclasspath when
forking.  Also, if you want to build incrementally, use the incremental
flag.  There is no optimization when batch- building a second time
(unlike the Javac task, which can prune up-to-date classes).
You can also explicitly set the reweavable options to see if that makes
a difference.
(Finally, I assume you are not running Ant against the same target
classes as AJDT/eclipse.)

Let us know how it works out!  Maybe it is a bug!
Wes

On Fri, 24 Feb 2006 12:58:57 -0800
 "Ron Bodkin" <rbodkin@xxxxxxxxxxxxxx> wrote:
> Hi Diane,
> 
> Could you post the ant task(s) that compile the AspectJ code? I am 
> wondering if there's something about that that's causing the problem. 
> How are you determining what classes to recompile? Is it possible that

> more than one ant task is recompiling to the same class files, but 
> with different AspectJ configurations?
> 
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx 
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Nguyen, Diane
> Sent: Friday, February 24, 2006 9:43 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: RE: [aspectj-users] badWeaverState exception on iajc w/out 
> prior clean
> 
> If I run ant clean, then ant, then ant again, things are fine, it 
> succeeds because there weren't any changes to compile the second time.
> If I run ant clean, then ant, then make a change to my aspect or test,

> then ant again, I get the exception.
> 
> I found that one of my colleagues DID install older versions of 
> AspectJ.
> There was an aspectjrt-1.1.1.jar in the ant lib directory, which I've 
> deleted. There was also an older aspectjrt jar installed with Cactus. 
> I removed the cactus jars from the classpath and removed our Cactus 
> tests from the compilation. However, I still get the exception.
> 
> Other than that, I can't find any jars or source that was compiled 
> with aspects or using the iajc task in my classpath or inpath.
> 
> Again, thanks your help!
> 
> diane
> 
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx 
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ron Bodkin
> Sent: Wednesday, February 22, 2006 9:18 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: RE: [aspectj-users] badWeaverState exception on iajc w/out 
> prior clean
> 
> Diane,
> 
> What happens if you run ant clean, then ant, then ant again? Does the 
> problem occur? Are you able to narrow down which jar
> file(s) cause the
> problem and how they get created?
> 
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx 
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Nguyen, Diane
> Sent: Tuesday, February 21, 2006 1:17 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: RE: [aspectj-users] badWeaverState exception on iajc w/out 
> prior clean
> 
> Thanks for the response!
> 
> Unfortunately, I don't think that's what is causing my bad WeaverState

> exception. I'm using ajdt 1.3.0 (the latest from the eclipse AJDT 
> site) and AspectJ 1.5.0 from Dec 20 2005. These are the only aspectJ 
> downloads I've installed on my computer, and this is the only iajc 
> compilation in my build.xml file.
> 
> Does it matter what was used to compile the jars in my inpath? Just a 
> stab in the dark...
> 
> thanks again!
> diane
> 
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx 
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ron Bodkin
> Sent: Friday, February 17, 2006 4:57 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: RE: [aspectj-users] badWeaverState exception on iajc w/out 
> prior clean
> 
> Hi Diane,
> 
> One likely reason for the problem is that you somehow have an older 
> version of AspectJ that is doing some of the building.
> E.g., are you
> perhaps using a version of AJDT from before 1.5.0 final to build these

> same classes? AspectJ 1.5.0 would choke on the output of development 
> releases of AJDT from before AspectJ 1.5.0 final (AJDT 1.3.0 final).
> 
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx 
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Nguyen, Diane
> Sent: Friday, February 17, 2006 4:40 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] badWeaverState exception on iajc w/out prior 
> clean
> 
> Hello,
> 
> I am trying to compile junit tests and aspects in my application and 
> keep running into a "bad WeaverState.Kind: -115" error when I 
> recompile without cleaning all my source first. As rebuilding is 
> obviously a bear to have to do each time I make a tweak, I'd love to 
> learn why this occurs and how I can stop it.
> 
> I am using AspectJ 1.5.0, jdk1.5.0_02, ant 1.6.2.
> 
> Below are the iajc tag in my build.xml and the error output.
> 
> Any help/tips/corrections are greatly appreciated!
> Thanks!
> 
> diane
> 
> 		<iajc srcdir="${test.src}" 
> 			destdir="${test.classes}" 
> 			deprecation="${compile.deprecation}"
> 			debug="${compile.debug}"
> 			source="1.5"
> 			maxmem="640m"
> 			fork="true">
> 			<classpath>
> 				... lots of jars ...
> 			</classpath>
> 			<inpath>
> 				<pathelement location="some.jar"/>
> 				<pathelement location="another.jar"/>
> 				<pathelement location="${test.classes}"
> />
> 			</inpath>
> 
> 		</iajc>
> 
> 
> compile-tests-with-aspects:
>      [iajc] ABORT
>      [iajc]
>      [iajc] Exception thrown from AspectJ 1.5.0
> 
>      [iajc] This might be logged as a bug already -- find current bugs

> at
>      [iajc]
>
http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&component
> =Compiler
> 
>      [iajc] Bugs for exceptions thrown have titles File:line from the 
> top stack,
> 
>      [iajc] e.g., "SomeFile.java:243"
> 
>      [iajc] If you don't find the exception below in a bug, please add

> a new bug
> 
>      [iajc] at
>
http://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ
>      [iajc] To make the bug a priority, please include a test program
>      [iajc] that can reproduce this exception.
>      [iajc] bad WeaverState.Kind: -115
> 
>      [iajc] when batch building with classpath:
> <classpath here>
>      [iajc] bad WeaverState.Kind: -115
>      [iajc] java.lang.RuntimeException: bad
> WeaverState.Kind: -115
>      [iajc]     at
>
org.aspectj.weaver.WeaverStateInfo.read(WeaverStateInfo.java:
> 142)
>      [iajc]     at
> org.aspectj.weaver.AjAttribute.read(AjAttribute.java:98)
>      [iajc]     at
>
org.aspectj.weaver.bcel.BcelAttributes.readAjAttributes(BcelA
> ttributes.java:59)
>      [iajc]     at
>
org.aspectj.weaver.bcel.BcelObjectType.unpackAspectAttributes
> (BcelObjectType.java:273)
>      [iajc]     at
>
org.aspectj.weaver.bcel.BcelObjectType.<init>(BcelObjectType.
> java:134)
>      [iajc]     at
>
org.aspectj.weaver.bcel.BcelWorld.makeBcelObjectType(BcelWorl
> d.java:257)
>      [iajc]     at
>
org.aspectj.weaver.bcel.BcelWorld.addSourceObjectType(BcelWor
> ld.java:314)
>      [iajc]     at
>
org.aspectj.weaver.bcel.BcelWeaver.addClassFile(BcelWeaver.ja
> va:386)
>      [iajc]     at
>
org.aspectj.weaver.bcel.BcelWeaver.addClassFile(BcelWeaver.ja
> va:401)
>      [iajc]     at
>
org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBce
> lWorld(AjBuildManager.java:658)
>      [iajc]     at
>
org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild
> (AjBuildManager.java:209)
>      [iajc]     at
>
org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBu
> ild(AjBuildManager.java:156)
>      [iajc]     at
>
org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:1
> 12)
>      [iajc]     at
>
org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:
> 60)
>      [iajc]     at
> org.aspectj.tools.ajc.Main.run(Main.java:326)
>      [iajc]     at
> org.aspectj.tools.ajc.Main.runMain(Main.java:240)
>      [iajc]     at
> org.aspectj.tools.ajc.Main.main(Main.java:83)
> 
> 
>      [iajc] 1 fail|abort
> 
> BUILD FAILED
> C:\views\yadda-yadda-yadda\build.xml:386:
> failure[-1] running ajc
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Attachment: dummy-project.zip
Description: dummy-project.zip

C:\views\barrio-xp2-user-K1.2\un_CUSA\Projects\dummy-project>ant clean
Buildfile: build.xml
     [echo] project: cuadmin

clean:
   [delete] Deleting directory C:\views\barrio-xp2-user-K1.2\un_CUSA\Projects\du
mmy-project\build

BUILD SUCCESSFUL
Total time: 1 second
C:\views\barrio-xp2-user-K1.2\un_CUSA\Projects\dummy-project>ant
Buildfile: build.xml
     [echo] project: cuadmin

prepare-tests:
    [mkdir] Created dir: C:\views\barrio-xp2-user-K1.2\un_CUSA\Projects\dummy-pr
oject\build\test

prepare:

compile:
    [mkdir] Created dir: C:\views\barrio-xp2-user-K1.2\un_CUSA\Projects\dummy-pr
oject\build\classes
    [javac] Compiling 1 source file to C:\views\barrio-xp2-user-K1.2\un_CUSA\Pro
jects\dummy-project\build\classes

compile-tests-with-aspects:
    [mkdir] Created dir: C:\views\barrio-xp2-user-K1.2\un_CUSA\Projects\dummy-pr
oject\build\test\classes

all:

BUILD SUCCESSFUL
Total time: 4 seconds
C:\views\barrio-xp2-user-K1.2\un_CUSA\Projects\dummy-project>ant
Buildfile: build.xml
     [echo] project: cuadmin

prepare-tests:

prepare:

compile:

compile-tests-with-aspects:

all:

BUILD SUCCESSFUL
Total time: 3 seconds
C:\views\barrio-xp2-user-K1.2\un_CUSA\Projects\dummy-project>ant
Buildfile: build.xml
     [echo] project: cuadmin

prepare-tests:

prepare:

compile:

compile-tests-with-aspects:
     [iajc] ABORT
     [iajc]
     [iajc] Exception thrown from AspectJ 1.5.0

     [iajc] This might be logged as a bug already -- find current bugs at
     [iajc]   http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&component
=Compiler

     [iajc] Bugs for exceptions thrown have titles File:line from the top stack,

     [iajc] e.g., "SomeFile.java:243"

     [iajc] If you don't find the exception below in a bug, please add a new bug

     [iajc] at http://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ
     [iajc] To make the bug a priority, please include a test program
     [iajc] that can reproduce this exception.
     [iajc] bad WeaverState.Kind: -115

     [iajc] when batch building with classpath: C:\Program Files\Java\jdk1.5.0_0
2\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.5.0_02\jre\lib\ext\localedata
.jar;C:\Program Files\Java\jdk1.5.0_02\jre\lib\ext\sunjce_provider.jar;C:\Progra
m Files\Java\jdk1.5.0_02\jre\lib\ext\sunpkcs11.jar;C:\views\barrio-xp2-user-K1.2
\un_CUSA\Projects\dummy-project\build\test\classes;C:\views\barrio-xp2-user-K1.2
\un_CUSA\Projects\dummy-project\build\classes;C:\CommSvr\private\ThirdPartyLib\j
ava\aspectj1.5\lib\aspectjrt.jar;C:\CommSvr\private\ThirdPartyLib\java\junit3.8.
1\junit.jar;
     [iajc] bad WeaverState.Kind: -115
     [iajc] java.lang.RuntimeException: bad WeaverState.Kind: -115
     [iajc]     at org.aspectj.weaver.WeaverStateInfo.read(WeaverStateInfo.java:
142)
     [iajc]     at org.aspectj.weaver.AjAttribute.read(AjAttribute.java:98)
     [iajc]     at org.aspectj.weaver.bcel.BcelAttributes.readAjAttributes(BcelA
ttributes.java:59)
     [iajc]     at org.aspectj.weaver.bcel.BcelObjectType.unpackAspectAttributes
(BcelObjectType.java:273)
     [iajc]     at org.aspectj.weaver.bcel.BcelObjectType.<init>(BcelObjectType.
java:134)
     [iajc]     at org.aspectj.weaver.bcel.BcelWorld.makeBcelObjectType(BcelWorl
d.java:257)
     [iajc]     at org.aspectj.weaver.bcel.BcelWorld.addSourceObjectType(BcelWor
ld.java:314)
     [iajc]     at org.aspectj.weaver.bcel.BcelWeaver.addClassFile(BcelWeaver.ja
va:386)
     [iajc]     at org.aspectj.weaver.bcel.BcelWeaver.addClassFile(BcelWeaver.ja
va:401)
     [iajc]     at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBce
lWorld(AjBuildManager.java:658)
     [iajc]     at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild
(AjBuildManager.java:209)
     [iajc]     at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBu
ild(AjBuildManager.java:156)
     [iajc]     at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:1
12)
     [iajc]     at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:
60)
     [iajc]     at org.aspectj.tools.ajc.Main.run(Main.java:326)
     [iajc]     at org.aspectj.tools.ajc.Main.runMain(Main.java:240)
     [iajc]     at org.aspectj.tools.ajc.Main.main(Main.java:83)


     [iajc] 1 fail|abort

BUILD FAILED
C:\views\barrio-xp2-user-K1.2\un_CUSA\Projects\dummy-project\build.xml:58: failu
re[-1] running ajc

Total time: 1 second
C:\views\barrio-xp2-user-K1.2\un_CUSA\Projects\dummy-project>

Back to the top