I tried to use Aspectj with springsource tools 2.5.2 and virgo using the sample in the Bug 333646.
if i deploy directly the plugins org.example.spring-1.0.0.jar and org.example.aspect-1.0.0b.jar in virgo ,it works fine.
But if i import the org.example.aspect-1.0.0b.jar in spring source tools 2.5.2 , export and deploy it in virgo i get :
09:22:20.141 [region-dm-6] ERROR System.err -GRAVE: register definition failed
09:22:20.141 [region-dm-6] ERROR System.err -org.aspectj.weaver.BCException: Unable to continue, this version of AspectJ supports classes built with weaver version 6.0 but the class org.example.aspect.MyAspect is version 7.0
Looks like STS is using v7 of the AspectJ weaver and the woven code is incompatible with the older AspectJ runtime in Virgo. I'll ask a tooling expert to comment on whether you can somehow run the old weaver in STS 2.5.2.
The alternative is to upgrade the level of AspectJ in Virgo which might be tricky for you to manage.
I had the exact same problem you have right now. Unfortunately with the AJDT plugin there is no way (at least I don't know one) to define a compability level. Therefore I had to use a build tool (tested it with Maven & Ant)) to get the things done.
AspectJ 1.6.7 uses byte-code version 6, and AspectJ 1.6.8+ uses version 7. An AspectJ runtime can run code compiled with a byte code version less than itself, but not greater. What I mean is that AspectJ code compiled using 1.6.8+ cannot use a runtime of 1.6.7, but the reverse is not true.
For you, this means that you either need to upgrade your AspectJ version being used in Virgo (recommended), or downgrade the version used to compile your code (not recommended).
I am a little surprised that Virgo is using such an old version of AspectJ. We are currently at 1.6.11. Glynn will have to describe to you how to upgrade to a later version of the AspectJ runtime since I am not too familiar with Virgo.
If you choose to downgrade your compiler version, you have to options:
1. download 1.6.7 from http://eclipse.org/aspectj and compile your code on the command line. The downside of this is that you will no longer be able to use the Virgo tooling inside of Eclipse.
2. downgrade your STS to 2.2.0 or earlier. The downside is that this is a real pain and you will be losing many features.
The only realistic option is to upgrade your aspectj runtime in Virgo.
i have replaced com.springsource.org.aspectj.weaver_1.6.6.RELEASE.jar in kernel folder by com.springsource.org.aspectj.weaver_1.6.10.RELEASE.jar and i have added :
in org.eclipse.virgo.kernel.launch.properties and it worked fine.
i don't know if this solution is the right solution to upgrade the aspectj version in Virgo .
Frieder Heugel Messages: 60 Registered: October 2010 Location: Basel, CH
Glyn Normington wrote on Thu, 31 March 2011 10:24
One more thing, please could you say where you got the AspectJ bundle from as it might help others who find this thread.
I think the easiest way to get proper AspectJ bundles is to take the jar files that are coming along with the AJDT plugin and transform them into OSGi bundles.The AJDT team has already taken care of splitting runtime and weaver to different jar files so one doesn't have to take care of overlapping package exports (see bug 333855).