Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » org.eclipse.equinox.weaving.hook and custom target platform(With our own target platform how do we use org.eclipse.equinox.weaving.hook properly?)
org.eclipse.equinox.weaving.hook and custom target platform [message #647691] Fri, 07 January 2011 18:58 Go to next message
Craig Ching is currently offline Craig ChingFriend
Messages: 12
Registered: July 2009
Junior Member
Hi all!

We have some code where we use Equinox Aspects with the org.eclipse.equinox.weaving.hook. We also have our own target platform that we instantiate when we do development. We have added the hook bundle fragment to our target platform, however, we always end up getting this error:

!ENTRY org.eclipse.osgi 4 0 2011-01-07 12:55:32.672
!MESSAGE Bundle org.eclipse.equinox.weaving.hook not found.
[org.eclipse.equinox.weaving.aspectj] info Starting AspectJ weaving service ...
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.weaving.aspectj.AspectJWeavingActivator.start(Unknown Source)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374)
	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/equinox/service/weaving/IWeavingServiceFactory
	at org.eclipse.equinox.weaving.aspectj.AspectJWeavingStarter.start(Unknown Source)
	... 19 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.equinox.service.weaving.IWeavingServiceFactory
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:460)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
	... 20 more


We've resolved this in our command-line version of our program by including the hook jar on the classpath. What we'd like to do is have a PDE run configuration that works as well. Is this possible? I don't see a way for us to specify the hook jar in the classpath on either the run configuration or in the target platform editor.
Re: org.eclipse.equinox.weaving.hook and custom target platform [message #647722 is a reply to message #647691] Sat, 08 January 2011 04:01 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
I am not exactly sure why you are seeing this problem. But, here is a possibility.

Make sure that your org.eclipse.osgi bundle is in the same directory as your o.e.e.weaving.hook fragment. This means that in your workspace, you should import the o.e.osgi bundle as a binary plugin project. Alternatively, you can use the variants of the bundles that are in your Eclipse's plugins directory.
Re: org.eclipse.equinox.weaving.hook and custom target platform [message #647952 is a reply to message #647691] Mon, 10 January 2011 15:14 Go to previous messageGo to next message
Craig Ching is currently offline Craig ChingFriend
Messages: 12
Registered: July 2009
Junior Member
Hi Andrew!

Thanks for the reply. Yeah, that was one track I was going down, trying to figure out, in a target platform, which org.eclipse.osgi bundle are we using? Because the target platform doesn't give us a way to say what that should be, I guess I should assume that it's using the IDE's platform bundle. And then we would need to use not our hook bundle, but that which comes with AJDT and is installed in the IDE's plugins directories.

That's a good point, let me try that and see where that lands me.

Thanks!

Cheers,
Craig
Re: org.eclipse.equinox.weaving.hook and custom target platform [message #647979 is a reply to message #647952] Mon, 10 January 2011 16:24 Go to previous message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
The easiest thing to do (which is the way I recommend anyone developing AJDT should work) is to import all of the relevant weaving bundles as well as your target osgi bundle into the workspace as binary plugins. This way you are sure that all of the bundles are correct and colocated.

Then, of course, you need to make sure two more things:

1. the org.eclipse.equinox.weaving.aspectj bundle is autostarted
2. the config.ini for your launch configuration has the osgi.framework.extensions=org.eclipse.equinox.weaving.hook
line.
Previous Topic:64-Bit Installation Problem
Next Topic:Eclipse helios Crash when adding Ajdt
Goto Forum:
  


Current Time: Thu Apr 25 11:10:02 GMT 2024

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

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

Back to the top