Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] NullPointerException in org.aspectj.weaver.ReferenceType.getTypeVariables() - Aspectj 1.5.3


Thanks, Andy, for responding so quickly.

Upgrading our version is going to be difficult. A couple of products we integrate with currently use 1.5.3. Many of our jars run with the classpath of another piece of software. So upgrading would have to be a coordinated effort.


Our setup is somewhat complex, and it might be best if I give you a high level description of how we're doing things (it is very likely we're doing things incorrectly ;)). We have two sets of sources: server and client. The server side gets compiled to standard jar files while the client side are all Eclipse plug-ins that get built into an RCP. Some classes are shared between the two sides. The aspect we use is for logging entry and exits. For the PDE Build, I compile the plug-in that contains the aspect along with all our logging and exception classes together using <iajc>. I then store a that jar to be used to weave everything else. Throughout the rest of the build, <javac> compiles and <iajc> performs a binary weave.


The main reason we stuck with <javac> to do all our compiles is that PDE Builder just doesn't provide a nice way to swap our <javac> with <iajc>. (I'm sure you know about this.) One question I had is when just weaving, is it necessary to pass <iajc> the classpath used to compile? Am I losing anythign by only supplying aspectjrt.jar?


As far as the ordering goes, when it fails, there is no output from running in verbose mode:


-weave:

    [iajc] ajc [-d, /autobuild/private/prebuild_2008.10.06_15.15.02.30784/v1r1m0.bbp/int/gen/cmn.pgm/net.bbp/server/build/classes/com.ibm.bbp.net.server, -verbose, -source, 1.5, -target, 1.5, -classpath, /autobuild/private/prebuild_2008.10.06_15.15.02.30784/v1r1m0.bbp/int/cmvc/build/prereq/aspectj/aspectjrt.jar, -aspectpath, /autobuild/private/prebuild_2008.10.06_15.15.02.30784/v1r1m0.bbp/int/gen/cmn.pgm/core.bbp/common/build/aspectj/bbpAspects.jar, -inpath, /autobuild/private/prebuild_2008.10.06_15.15.02.30784/v1r1m0.bbp/int/gen/cmn.pgm/net.bbp/server/build/classes/com.ibm.bbp.net.server]

    [iajc] info Pipelining compilation

    [iajc] info weaver operating in reweavable mode.  Need to verify any required types exist.

    [iajc] java.lang.NullPointerException

    [iajc]         at org.aspectj.weaver.ReferenceType.getTypeVariables(ReferenceType.java:555)

    [iajc]         at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.fixUpCircularDependencies(BcelGenericSignatureToTypeXConverter.java:257)

    [iajc]         at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:47)

    [iajc]         at org.aspectj.weaver.bcel.BcelObjectType.ensureGenericSignatureUnpacked(BcelObjectType.java:685)


So I guess whatever the problem is, its the first class being woven. Would turning off the pipelining work if we're not compiling with <iajc>? Is there any other way to influence the order?


Finally I'd be happy to give the debug version a shot. Finding out why we're failing could give me the ammunition to push everyone to upgrade to 1.6.2.


Thanks,


I tried replying to your e-mail address, but it got rejected for some reason.


Alej.
Small-Medium Enterprise Platform Development
IBM - Rochester, MN

Dept: V2TA Bldg: 050-3 Office: H110
T/L 553-1962; Direct (507)253-1962
alej@xxxxxxxxxx


Small-Medium Enterprise Platform Development
IBM - Rochester, MN

Dept: V2TA Bldg: 050-3 Office: H110
T/L 553-1962; Direct (507)253-1962
alej@xxxxxxxxxx

 


"Andy Clement" <andrew.clement@xxxxxxxxx>
Sent by: aspectj-dev-bounces@xxxxxxxxxxx

10/06/2008 08:28 PM

Please respond to
AspectJ developer discussions <aspectj-dev@xxxxxxxxxxx>

To
"AspectJ developer discussions" <aspectj-dev@xxxxxxxxxxx>
cc
Subject
Re: [aspectj-dev] NullPointerException in        org.aspectj.weaver.ReferenceType.getTypeVariables() - Aspectj 1.5.3





Hi Alejandro,

I've been browsing bugzilla to see if your problem has already been addressed.  I have fixed many things to do with null delegates but 1.5.3 is quite a while ago and i can't specifically remember a problem in getTypeVariables().  A null delegate is not something I can just guard against as it indicates some violation somewhere of a basic assumption made during compilation.  I wouldn't necessarily recommend moving to 1.5.4 as I don't know it is specifically fixed in that release - and if I were suggesting to upgrade to any release, i'd say go for 1.6.2 as it has about 200 other fixes since
1.5.4.  However, I can understand your situation with not necessarily wanting to upgrade right now.  I am happy to investigate this issue with you but will probably need to give you a debug version of 1.5.3 that includes extra debug around the failure.  If we simply know the reference type in question it may help us with the problem.

However, intermittent failures during the 1.5.3 release were typically down to the new pipeline compilation feature that had been added in that release.  The pipeline is only loosely defined to ensure aspects go first, other types follow in any order - and depending on the JVM and the machine, that order can vary.  You could try turning on the verbose mode for the ant task (or is it the debug mode, one of those!) and that should tell you the ordering with lots of 'compiled:' and 'woven:' messages.  If the pipeline is to blame then each time the failure occurs that ordering will be the same, and when there is no failure it will be different.  Or the pipeline can be turned off completely with X="-Xset:pipelineCompilation=false" in the Ant iajc call - but that will use much more memory as everything is compiled first then everything is woven.

Other times I've seen issues with delegates in those early generics supporting releases were when type bounds were arrays (eg. int[]) or were themselves other type variables.

let me know how you want to proceed, either on the list or via email.

cheers,
Andy.

2008/10/6 Alejandro Bascuas <alej@xxxxxxxxxx>

Hi,


We have a project that at build time performs binary weaving of aspects on class files produced by IBM Java (J2RE 1.5.0 IBM J9 2.3 Linux amd64-64). We're running AspectJ
1.5.3. Upgrading to 1.5.4 is an option, but would be more work than we'd rather do in the immediate future.

At a particular point in the build, we intermittently hit a NullPointerException in org.aspectj.weaver.ReferenceType:


   [iajc] info Pipelining compilation

   [iajc] info weaver operating in reweavable mode.  Need to verify any required types exist.

   [iajc] java.lang.NullPointerException

   [iajc]         at org.aspectj.weaver.ReferenceType.getTypeVariables(ReferenceType.java:555)

   [iajc]         at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.fixUpCircularDependencies(BcelGenericSignatureToTypeXConverter.java:257)

   [iajc]         at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:47)

   [iajc]         at org.aspectj.weaver.bcel.BcelObjectType.ensureGenericSignatureUnpacked(BcelObjectType.java:685)

   [iajc]         at org.aspectj.weaver.bcel.BcelObjectType.getDeclaredInterfaces(BcelObjectType.java:201)

   [iajc]         at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:398)

   [iajc]         at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65)

   [iajc]         at org.aspectj.weaver.ResolvedType.collectInterTypeMungers(ResolvedType.java:1156)

   [iajc]         at org.aspectj.weaver.ResolvedType.collectInterTypeMungers(ResolvedType.java:1158)

   [iajc]         at org.aspectj.weaver.ResolvedType.getInterTypeMungersIncludingSupers(ResolvedType.java:1135)

   [iajc]         at org.aspectj.weaver.ResolvedType.checkInterTypeMungers(ResolvedType.java:1202)

   [iajc]         at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1588)

   [iajc]         at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeaver.java:1563)

   [iajc]         at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1341)

   [iajc]         at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1161)


Looking at the source code, it is clear that the 'delegate' field is set to null. This problem doesn't occur all the time, but often enough to cause us concern. It happens on multiple build servers at seemingly random times. Our main build servers run 64bit Intel Xeon CPUs, with 4 GB of RAM, and SLES 10 SP1. To my knowledge no one has encountered this running an Ant build on a development workstation (32bit Windows).


Any help you can provide is greatly appreciated. We're looking to simply understand what the problem is so our paranoia can decrease and hopefully a workaround so that we don't see it again.


Thanks,


Alejandro Bascuas

Small-Medium Enterprise Platform Development
IBM - Rochester, MN

Dept: V2TA Bldg: 050-3 Office: H110
T/L 553-1962; Direct (507)253-1962

alej@xxxxxxxxxx
_______________________________________________
aspectj-dev mailing list

aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev

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


Back to the top