Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Aspectj + spring source tools + Virgo
Aspectj + spring source tools + Virgo [message #662337] Wed, 30 March 2011 09:41 Go to next message
moha  is currently offline moha Friend
Messages: 43
Registered: March 2011
Member
Hi,

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

any idea ,

thanks in advance.
Re: Aspectj + spring source tools + Virgo [message #662339 is a reply to message #662337] Wed, 30 March 2011 09:52 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
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.
Re: Aspectj + spring source tools + Virgo [message #662347 is a reply to message #662339] Wed, 30 March 2011 10:18 Go to previous messageGo to next message
moha  is currently offline moha Friend
Messages: 43
Registered: March 2011
Member
Dear Glyn,

thanks for your information,

Now i try to modify the plugin org.example.aspect using aspectj and eclipse Hélios , i export the plugin and i deploy it in virgo 2.1.0,
i get the exception :

10:11:41.868 [region-dm-6] ERROR System.err -30 mars 2011 10:11:41 org.aspectj.weaver.tools.Jdk14Trace error
10:11:41.868 [region-dm-6] ERROR System.err -GRAVE: register definition failed
10:11:41.868 [region-dm-6] ERROR System.err -java.lang.RuntimeException: Cannot register non aspect: org$example$aspect$MyAspect , org.example.aspect.MyAspect
10:11:41.868 [region-dm-6] ERROR System.err - at org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect(BcelWeav er.java:222)
10:11:41.868 [region-dm-6] ERROR System.err - at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.regist erAspects(ClassLoaderWeavingAdaptor.java:433)
10:11:41.884 [region-dm-6] ERROR System.err - at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.regist erDefinitions(ClassLoaderWeavingAdaptor.java:267)
10:11:41.884 [region-dm-6] ERROR System.err - at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initia lize(ClassLoaderWeavingAdaptor.java:159)
10:11:41.884 [region-dm-6] ERROR System.err - at org.eclipse.equinox.weaving.aspectj.loadtime.OSGiWeavingAdap tor.initialize(Unknown Source)
10:11:41.884 [region-dm-6] ERROR System.err - at org.eclipse.equinox.weaving.aspectj.AspectJWeavingService.en sureAdaptorInit(Unknown Source)
10:11:41.884 [region-dm-6] ERROR System.err - at org.eclipse.equinox.weaving.aspectj.AspectJWeavingService.pr eProcess(Unknown Source)
10:11:41.884 [region-dm-6] ERROR System.err - at org.eclipse.equinox.weaving.adaptors.WeavingAdaptor.weaveCla ss(Unknown Source)
10:11:41.884 [region-dm-6] ERROR System.err - at org.eclipse.equinox.weaving.hooks.WeavingHook.processClass(U nknown Source)
10:11:41.884 [region-dm-6] ERROR System.err - at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:575)
10:11:41.884 [region-dm-6] ERROR System.err - at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla ssImpl(ClasspathManager.java:550)
10:11:41.884 [region-dm-6] ERROR System.err - at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClassImpl(ClasspathManager.java:481)
10:11:41.884 [region-dm-6] ERROR System.err - at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass_LockClassLoader(ClasspathManager.java:469)
10:11:41.884 [region-dm-6] ERROR System.err - at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:449)
10:11:41.900 [region-dm-6] ERROR System.err - at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:216)
10:11:41.900 [region-dm-6] ERROR System.err - at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass (BundleLoader.java:393)
10:11:41.900 [region-dm-6] ERROR System.err - at org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:469)
10:11:41.900 [region-dm-6] ERROR System.err - at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:422)
10:11:41.900 [region-dm-6] ERROR System.err - at org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:410)
10:11:41.900 [region-dm-6] ERROR System.err - at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:107)
10:11:41.900 [region-dm-6] ERROR System.err - at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelB undleClassLoader.loadClass(KernelBundleClassLoader.java:135)
10:11:41.900 [region-dm-6] ERROR System.err - at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
10:11:41.900 [region-dm-6] ERROR System.err - at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(Bund leLoader.java:338)
10:11:41.900 [region-dm-6] ERROR System.err - at org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:232)
10:11:41.900 [region-dm-6] ERROR System.err - at org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1197)
10:11:41.900 [region-dm-6] ERROR System.err - at org.springframework.osgi.util.BundleDelegatingClassLoader.fi ndClass(BundleDelegatingClassLoader.java:99)
10:11:41.900 [region-dm-6] ERROR System.err - at org.springframework.osgi.util.BundleDelegatingClassLoader.lo adClass(BundleDelegatingClassLoader.java:156)
10:11:41.900 [region-dm-6] ERROR System.err - at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Re: Aspectj + spring source tools + Virgo [message #662400 is a reply to message #662347] Wed, 30 March 2011 14:45 Go to previous messageGo to next message
Frieder Heugel is currently offline Frieder HeugelFriend
Messages: 61
Registered: October 2010
Location: Basel, CH
Member
Hi moha,

sorry but I haven't seen your post in the forum. Anyway I already answered your question here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=333646#c29

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.

Bye
Frieder
Re: Aspectj + spring source tools + Virgo [message #662432 is a reply to message #662347] Wed, 30 March 2011 15:58 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
Hi there,

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.
Re: Aspectj + spring source tools + Virgo [message #662433 is a reply to message #662432] Wed, 30 March 2011 16:13 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
I've raised bug 341390 to cover upgrading AspectJ in Virgo, although I should point out that this is the first situation that we've come across where a user would benefit from the upgrade.

This will involve creating OSGi bundles for AspectJ 1.6.11 or later. Once these bundles are available, it may be possible for users to retrofit them to Virgo 2.1.
Re: Aspectj + spring source tools + Virgo [message #662469 is a reply to message #662433] Wed, 30 March 2011 18:00 Go to previous messageGo to next message
moha  is currently offline moha Friend
Messages: 43
Registered: March 2011
Member
thks for your informations,

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 :
file:lib/kernel/com.springsource.org.aspectj.weaver_1.6.10.RELEASE.jar@start,\
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 .

Re: Aspectj + spring source tools + Virgo [message #662579 is a reply to message #662469] Thu, 31 March 2011 08:24 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
The main issue was getting a suitable AspectJ weaver bundle, which you appear to have done. You did the right thing to reconfigure Virgo. Thanks for feeding back.

One more thing, please could you say where you got the AspectJ bundle from as it might help others who find this thread.
Re: Aspectj + spring source tools + Virgo [message #663049 is a reply to message #662579] Sat, 02 April 2011 19:06 Go to previous messageGo to next message
Frieder Heugel is currently offline Frieder HeugelFriend
Messages: 61
Registered: October 2010
Location: Basel, CH
Member
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).

[Updated on: Sat, 02 April 2011 20:32]

Report message to a moderator

Re: Aspectj + spring source tools + Virgo [message #663174 is a reply to message #662579] Mon, 04 April 2011 08:34 Go to previous messageGo to next message
moha  is currently offline moha Friend
Messages: 43
Registered: March 2011
Member
I copied com.springsource.org.aspectj.weaver_1.6.10.RELEASE.jar from the plugins folder of sts-2.5.1.RELEASE.
Re: Aspectj + spring source tools + Virgo [message #663332 is a reply to message #663174] Mon, 04 April 2011 16:26 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Thanks.
Previous Topic:Tomcat export package error
Next Topic:Configuring Virgo for multiple instances
Goto Forum:
  


Current Time: Fri Apr 19 13:30:14 GMT 2024

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

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

Back to the top