Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » RCP Application LTW problem
RCP Application LTW problem [message #599005] Tue, 22 July 2008 01:02
Eclipse UserFriend
Originally posted by: burt.leung.gmail.com

Hi All,

I'm having problems getting the load-time weaving working on the RCP
Application project I'm working on.

To try to figure out what could be going wrong, I tried creating a simple
RCP application using the "Hello RCP" template/wizard via the Eclipse IDE.

So I've done the following so far:
1. Created a target platform based on RCP 3.4.
2. Added the following plugins to the target platform:

* org.aspectj.runtime_1.6.1.20080703120000
* org.aspectj.weaver_1.6.1.20080703120000
* org.eclipse.equinox.weaving.aspectj_1.0.0.200807082136
* org.eclipse.equinox.weaving.caching.j9_1.0.0.200807082136
* org.eclipse.equinox.weaving.caching_1.0.0.200807082136
* org.eclipse.equinox.weaving.hook_1.0.0.200807082136

3. Created the Hello RCP sample application. Created a .product file to
use to run the application.
2. Created a META-INF/aop.xml file that used the one aspect defined in the
sample RCP application.
3. Set the VM arg
" -javaagent:F:\hello3.4Workspace\target.3.4\plugins/org.aspec tj.weaver_1.6.1.20080703120000/aspectjweaver.jar "


If I run the application the output gives:
============================
osgi> [DefaultClassLoader@331059] info AspectJ Weaver Version 1.6.1rc1 built
on Thursday Jul 3, 2008 at 20:33:51 GMT
[DefaultClassLoader@331059] info register classloader
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@331059
[DefaultClassLoader@331059] info using configuration /META-INF/aop.xml
[DefaultClassLoader@331059] info register aspect aspects.HelloAspect
Jul 21, 2008 10:13:03 AM org.aspectj.weaver.tools.Jdk14Trace error
SEVERE: experiment2/Application
java.lang.NoClassDefFoundError: org/aspectj/lang/reflect/CodeSignature
at
org.aspectj.weaver.patterns.KindedPointcut.read(KindedPointc ut.java:245)
at org.aspectj.weaver.patterns.Pointcut.read(Pointcut.java:286)
at
org.aspectj.weaver.patterns.CflowPointcut.read(CflowPointcut .java:103)
at org.aspectj.weaver.patterns.Pointcut.read(Pointcut.java:295)
at org.aspectj.weaver.patterns.AndPointcut.read(AndPointcut.jav a:87)
at org.aspectj.weaver.patterns.Pointcut.read(Pointcut.java:290)
at
org.aspectj.weaver.AjAttribute$AdviceAttribute.read(AjAttrib ute.java:490)
at org.aspectj.weaver.AjAttribute.read(AjAttribute.java:101)
at
org.aspectj.weaver.bcel.BcelAttributes.readAjAttributes(Bcel Attributes.java:106)
at
org.aspectj.weaver.bcel.BcelMethod.unpackAjAttributes(BcelMe thod.java:191)
at org.aspectj.weaver.bcel.BcelMethod.<init>(BcelMethod.java:104)
at
org.aspectj.weaver.bcel.BcelObjectType.getDeclaredMethods(Bc elObjectType.java:248)
at
org.aspectj.weaver.ReferenceType.getDeclaredMethods(Referenc eType.java:524)
at
org.aspectj.weaver.ResolvedType.getDeclaredAdvice(ResolvedTy pe.java:748)
at
org.aspectj.weaver.ResolvedType.getDeclaredShadowMungers(Res olvedType.java:785)
at
org.aspectj.weaver.ResolvedType.collectShadowMungers(Resolve dType.java:626)
at
org.aspectj.weaver.ResolvedType.collectCrosscuttingMembers(R esolvedType.java:518)
at
org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect (CrosscuttingMembersSet.java:78)
at
org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect (CrosscuttingMembersSet.java:65)
at
org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect(BcelWeav er.java:203)
at
org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.regist erAspects(ClassLoaderWeavingAdaptor.java:398)
at
org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.regist erDefinitions(ClassLoaderWeavingAdaptor.java:239)
at
org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initia lize(ClassLoaderWeavingAdaptor.java:151)
at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoa derWeavingAdaptor.initialize(Aj.java:262)
at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoa derWeavingAdaptor.getWeavingAdaptor(Aj.java:267)
at
org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj. java:245)
at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:86)
at
org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.tr ansform(ClassPreProcessorAgentAdapter.java:52)
at
sun.instrument.TransformerManager.transform(TransformerManag er.java:122)
at
sun.instrument.InstrumentationImpl.transform(Instrumentation Impl.java:155)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:165)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:554)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla ssImpl(ClasspathManager.java:524)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClassImpl(ClasspathManager.java:455)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass_LockClassLoader(ClasspathManager.java:443)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:423)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:444)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:313)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1274)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:160)
at
org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:867)
at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:188)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Jul 21, 2008 10:13:03 AM org.aspectj.weaver.tools.Jdk14Trace info
INFO: Dumping to F:\eclipse3.4\.\ajcore.20080721.101303.562.txt
============================


I confirmed that the class org.aspectj.lang.reflect.CodeSignature is in
the target platform though (via the aspectrt.jar file), so it is puzzling.

In addition, I then tried to debug the application by setting a breakpoint
to stop at any Exception that occurs. The debuggers first break is at:
Thread [main] (Suspended (exception ClassNotFoundException))
ClassLoader.findBootstrapClass(String) line: not available [native
method] [local variables unavailable]
Launcher$ExtClassLoader(ClassLoader).findBootstrapClass0(Str ing) line:
891
Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line:
301
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line:
299
Launcher$AppClassLoader.loadClass(String, boolean) line: 268
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 251
InstrumentationImpl.loadClassAndCallPremain(String, String) line: 133

The class it can't find is given to be
"org.aspectj.weaver.loadtime.Agent". I checked and this class is also in
the target platform (via the aspectjweaver.jar file) so I'm puzzled by
this.

I made sure that the product has the right dependencies set too. E.g. The
"org.aspectj.runtime" and "org.aspectj.weaver" plugins are depended on.


Any help would be appreciated, thanks.

Burt
Previous Topic:RCP Application LTW problem
Next Topic:EMMA and AspectJ
Goto Forum:
  


Current Time: Sun Nov 23 06:14:37 GMT 2014

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

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