Weaving and OSGi [message #635391] |
Tue, 26 October 2010 12:12  |
Eclipse User |
|
|
|
Hi,
we're trying to get code weaving running inside an OSGi container and we
are getting nowhere. The symptom at the moment is the following exception:
java.lang.ClassNotFoundException:
org.eclipse.persistence.jpa.equinox.weaving.IWeaver
(see [4] for full trace)
The environment is a Riena server (OSGi and Jetty) on Eclipse 3.6 using
MySQL as data base. EclipseLink is version 2.1.1 (OSGi bundles Zip),
last downloaded today.
We have followed the wiki page [1]. Only in the Equinox configuration
section we diverged as we defined all start levels via the Eclipse run
configuration and passed along the second to forth row of these options
as VM arguments. Judging from the difference with and without the VM
arguments, this is working.
But the server is not starting as the stacktrace shows. It is working
properly without code weaving but obviously, without lazy loading, this
is not worth much. We have tried to follow hints tweaking the
persistence provider [2,3] but also with no luck.
Since a colleague and I have spend the entire day without getting
anywhere and since we have no idea on how we could proceed, any hint
would be greatly appreciated.
tia, stephan
[1]
http://wiki.eclipse.org/EclipseLink/Examples/OSGi/Equinox_By te_Code_Weaving
[2]
http://old.nabble.com/Bytecode-weaving-in-equinox-eclipse-rc p-applications-p28502398.html
[3] http://www.eclipse.org/forums/index.php?t=msg&goto=48701 1&
[4] Full stacktrace:
Tue Oct 26 17:50:58 CEST 2010 ERROR [Framework Event Dispatcher] null
FrameworkEvent ERROR
org.osgi.framework.BundleException: Exception in
de.product.internal.server.Activator.start() of bundle de.product.server.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:806)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:755)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:370)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.resu me(AbstractBundle.java:374)
at
org.eclipse.osgi.framework.internal.core.Framework.resumeBun dle(Framework.java:1067)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.r esumeBundles(StartLevelManager.java:561)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.r esumeBundles(StartLevelManager.java:546)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.i ncFWSL(StartLevelManager.java:459)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.d oSetStartLevel(StartLevelManager.java:243)
at
org.eclipse.osgi.framework.internal.core.StartLevelManager.d ispatchEvent(StartLevelManager.java:440)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEve nt(EventManager.java:227)
at
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread .run(EventManager.java:337)
Caused by: java.lang.NoClassDefFoundError:
org/eclipse/persistence/jpa/equinox/weaving/IWeaver
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:188)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:580)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla ssImpl(ClasspathManager.java:550)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClassImpl(ClasspathManager.java:490)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass_LockClassLoader(ClasspathManager.java:469)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:449)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:216)
at
org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass (BundleLoader.java:393)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:469)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:422)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:410)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at
org.eclipse.persistence.internal.jpa.deployment.osgi.equinox .EquinoxInitializer.registerTransformer(EquinoxInitializer.j ava:99)
at
org.eclipse.persistence.internal.jpa.deployment.JPAInitializ er.callPredeploy(JPAInitializer.java:94)
at
org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:127)
at
org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:65)
at javax.persistence.Persistence.createEntityManagerFactory(Unk nown Source)
at javax.persistence.Persistence.createEntityManagerFactory(Unk nown Source)
... 11 more
Caused by: java.lang.ClassNotFoundException:
org.eclipse.persistence.jpa.equinox.weaving.IWeaver
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:460)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:422)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:410)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 39 more
|
|
|
|
|
|
Re: Weaving and OSGi [message #636917 is a reply to message #636520] |
Wed, 03 November 2010 07:19  |
Eclipse User |
|
|
|
The source of this problem is a bug in the org.eclipse.persistence.dbws fragement which requries core despite core being its host bundle. So the solution is to remove this fragment from the target platform. Also, this shouldn't be a problem any longer when version 2.2 comes out because this fragment will be a standalone bundle by then.
Thanks again to Shaun for the great help.
stephan
|
|
|
Powered by
FUDForum. Page generated in 0.05130 seconds