Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider(EclipseLinkResourceImpl.openDatabase() causes a NoClassDefFoundError on PersistenceProvider)
[ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #815456] Wed, 07 March 2012 17:39 Go to next message
Mathieu Guillet is currently offline Mathieu GuilletFriend
Messages: 2
Registered: March 2012
Location: France
Junior Member
Hi,

i'm facing a NoClassDefFoundError when testing my EMF + Teneo + EclipseLink + JPA configuration on my RCP application.
The class apparently missing is "org.eclipse.persistence.jpa.osgi.PersistenceProvider" but it actually is in my plug-in dependencies (i've got org.eclipse.persistence.jpa.osgi;version="2.3.1" in my dependencies list).

So i guess it could be a class loading matter, but i'm not sure, and above all, i don't know how to resolve it!

The plug-in in question hold the EMF model definition, the model implementation and the model storing mecanism.


Here is the Java code source causing the error :

    /**
     * Save the event model in database.
     * 
     * @param eventModel
     *            the event model
     */
    public static void saveDatabase(final EventModel eventModel) {

        final String query = EclipseLinkURIUtil.createContentsEqualQuery(EventPackage.eINSTANCE.getEvent(),
                EventPackage.eINSTANCE.getEvent_Id(), -1);

        final URI eventDbURI = EclipseLinkURIUtil.createEclipseLinkURI("events", query);

        // save event model instance in database
        ResourceSet resourceSet = new ResourceSetImpl();
        resourceSet.getLoadOptions().putAll(getPersistenceUnitProperties());
        final Resource eventModelResource = resourceSet.createResource(eventDbURI);

        Assert.isTrue(eventModelResource instanceof EclipseLinkResourceImpl);

        eventModelResource.getContents().add(eventModel);
        try {
            eventModelResource.save(Collections.EMPTY_MAP);
        } catch (IOException e) {
            Logger.logError(e, "Unable to save Model to file [" + eventDbURI.toString() + "]", //$NON-NLS-1$ //$NON-NLS-2$
                    ReportPlugin.getDefault().getBundle());
        }
    }

    /**
     * Load the event model from database.
     * 
     * @param eventModel
     *            the event model
     */
    public static EventModel loadDatabase() {

        final String query = EclipseLinkURIUtil.createContentsEqualQuery(EventPackage.eINSTANCE.getEvent(),
                EventPackage.eINSTANCE.getEvent_Id(), -1);

        final URI eventDbURI = EclipseLinkURIUtil.createEclipseLinkURI("events", query);

        // save event model instance in database
        ResourceSet resourceSet = new ResourceSetImpl();
        resourceSet.getLoadOptions().putAll(getPersistenceUnitProperties());
        final Resource eventModelResource = resourceSet.getResource(eventDbURI, true);

        Assert.isTrue(eventModelResource instanceof EclipseLinkResourceImpl);

        EventModel model = null;
        if ((eventModelResource.getContents() != null) && (!eventModelResource.getContents().isEmpty())) {
            model = (EventModel) eventModelResource.getContents().get(0);
        }
        return model;
    }

    private static Map<String, Object> getPersistenceUnitProperties() {
        final HashMap<String, Object> options = new HashMap<String, Object>();
        options.put(PersistenceUnitProperties.CLASSLOADER, ClassLoaderResolver.getClassLoader());
        return options;
    }


Here is the stacktrace I get :
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/persistence/jpa/osgi/PersistenceProvider
	at org.eclipse.emf.teneo.eclipselink.resource.EclipseLinkResourceImpl.openDatabase(EclipseLinkResourceImpl.java:562)
	at org.eclipse.emf.teneo.eclipselink.resource.EclipseLinkResourceImpl.doLoad(EclipseLinkResourceImpl.java:498)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1511)
	at org.eclipse.emf.teneo.eclipselink.resource.EclipseLinkResourceImpl.load(EclipseLinkResourceImpl.java:405)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:255)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:270)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
	at com.mycompany.myplugin.reporting.event.util.EventUtils.loadDatabase(EventUtils.java:164)
	at com.mycompany.myplugin.reporting.eventcontroller.impl.EventModelControllerImpl.loadPersistence(EventModelControllerImpl.java:114)
	at com.mycompany.myplugin.reporting.eventcontroller.impl.EventModelControllerImpl.<init>(EventModelControllerImpl.java:42)
	at com.mycompany.myplugin.reporting.eventcontroller.impl.EventModelControllerImpl$$FastClassByGuice$$62e0f41b.newInstance(<generated>)
	at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
	at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:737)
	at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
	at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
	at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:75)
	at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:73)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
	at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:73)
	at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:60)
	at com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:944)
	at com.mycompany.myplugin.ioc.IocPlugin.injectMembers(IocPlugin.java:80)
	at com.mycompany.myplugin.audit.util.ReportingHandler.<init>(ReportingHandler.java:35)
	at com.mycompany.myplugin.audit.view.AuditView$2.<init>(AuditView.java:115)
	at com.mycompany.myplugin.audit.view.AuditView.createPartControl(AuditView.java:115)
	[...]
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at com.mycompany.myplugin.ssm.product.SSMApplication.start(SSMApplication.java:26)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.jpa.osgi.PersistenceProvider
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 88 more


And here is my plug-in Manifest.mf file :
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.mycompany.myplugin.reporting;singleton:=true
Bundle-Version: 0.1.0.qualifier
Bundle-Activator: com.mycompany.myplugin.reporting.ReportPlugin
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: com.google.guice,
 com.mysql.jdbc,
 com.mycompany.myplugin.logging,
 javax.annotation,
 javax.persistence;bundle-version="1.99.0",
 org.apache.commons.logging,
 org.eclipse.core.runtime,
 org.eclipse.emf.ecore,
 org.eclipse.emf.ecore.xmi,
 org.eclipse.emf.teneo.orm,
 org.eclipse.emf.teneo.eclipselink,
 org.eclipse.persistence.jpa;bundle-version="2.3.1",
 org.eclipse.persistence.jpa.osgi;bundle-version="2.3.1"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: com.mycompany.myplugin.reporting,
 com.mycompany.myplugin.reporting.event,
 com.mycompany.myplugin.reporting.event.impl,
 com.mycompany.myplugin.reporting.event.util,
 com.mycompany.myplugin.reporting.eventcontroller,
 com.mycompany.myplugin.reporting.message,
 com.mycompany.myplugin.reporting.syslog


Hopefully, this problem is not a real one and i just missed some configuration thing. Otherwise, any help would be greatly appreciated.

(I'm using org.eclipse.emf.teneo 1.1.2 and org.eclipse.emf.teneo.eclipselink 1.0.0)

Regards,
Mathieu

[Updated on: Wed, 07 March 2012 17:46]

Report message to a moderator

Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #815925 is a reply to message #815456] Thu, 08 March 2012 06:38 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mathieu,
Hmm, not sure where this is coming from, in an earlier version of eclipselink I know that this class was in another (the
main eclipselink) plugin and I think in 3.7 it was moved to this separate plugin.

Afaik the problem/solution is not in the source code but in the dependency definition of your plugin. Can you validate
the plugin dependencies (there is an option in the manifest.mf editor to do that)?
Is this jpa osgi plugin listed always together with the main org.eclipse.persistence.jpa plugin in all dependencies?

gr. Martin

On 03/07/2012 06:39 PM, Mathieu Guillet wrote:
> Hi,
>
> i'm facing a NoClassDefFoundError when testing my EMF + Teneo + EclipseLink + JPA configuration on my RCP application.
> The class apparently missing is "org.eclipse.persistence.jpa.osgi.PersistenceProvider" but it actually is in my plug-in
> dependencies (i've got org.eclipse.persistence.jpa.osgi;version="2.3.1" in my dependencies list).
>
> So i guess it could be a class loading matter, but i'm not sure, and above all, i don't know how to resolve it!
> The plug-in in question hold the EMF model definition, the model implementation and the model storing mecanism.
>
>
> Here is the Java code source causing the error :
>
>
> /**
> * Save the event model in database.
> * * @param eventModel
> * the event model
> */
> public static void saveDatabase(final EventModel eventModel) {
>
> final String query = EclipseLinkURIUtil.createContentsEqualQuery(EventPackage.eINSTANCE.getEvent(),
> EventPackage.eINSTANCE.getEvent_Id(), -1);
>
> final URI eventDbURI = EclipseLinkURIUtil.createEclipseLinkURI("events", query);
>
> // save event model instance in database
> ResourceSet resourceSet = new ResourceSetImpl();
> resourceSet.getLoadOptions().putAll(getPersistenceUnitProperties());
> final Resource eventModelResource = resourceSet.createResource(eventDbURI);
>
> Assert.isTrue(eventModelResource instanceof EclipseLinkResourceImpl);
>
> eventModelResource.getContents().add(eventModel);
> try {
> eventModelResource.save(Collections.EMPTY_MAP);
> } catch (IOException e) {
> Logger.logError(e, "Unable to save Model to file [" + eventDbURI.toString() + "]", //$NON-NLS-1$ //$NON-NLS-2$
> ReportPlugin.getDefault().getBundle());
> }
> }
>
> /**
> * Load the event model from database.
> * * @param eventModel
> * the event model
> */
> public static EventModel loadDatabase() {
>
> final String query = EclipseLinkURIUtil.createContentsEqualQuery(EventPackage.eINSTANCE.getEvent(),
> EventPackage.eINSTANCE.getEvent_Id(), -1);
>
> final URI eventDbURI = EclipseLinkURIUtil.createEclipseLinkURI("events", query);
>
> // save event model instance in database
> ResourceSet resourceSet = new ResourceSetImpl();
> resourceSet.getLoadOptions().putAll(getPersistenceUnitProperties());
> final Resource eventModelResource = resourceSet.getResource(eventDbURI, true);
>
> Assert.isTrue(eventModelResource instanceof EclipseLinkResourceImpl);
>
> EventModel model = null;
> if ((eventModelResource.getContents() != null) && (!eventModelResource.getContents().isEmpty())) {
> model = (EventModel) eventModelResource.getContents().get(0);
> }
> return model;
> }
>
> private static Map<String, Object> getPersistenceUnitProperties() {
> final HashMap<String, Object> options = new HashMap<String, Object>();
> options.put(PersistenceUnitProperties.CLASSLOADER, ClassLoaderResolver.getClassLoader());
> return options;
> }
>
> Here is the stacktrace I get :
>
> !STACK 0
> java.lang.NoClassDefFoundError: org/eclipse/persistence/jpa/osgi/PersistenceProvider
> at org.eclipse.emf.teneo.eclipselink.resource.EclipseLinkResourceImpl.openDatabase(EclipseLinkResourceImpl.java:562)
> at org.eclipse.emf.teneo.eclipselink.resource.EclipseLinkResourceImpl.doLoad(EclipseLinkResourceImpl.java:498)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1511)
> at org.eclipse.emf.teneo.eclipselink.resource.EclipseLinkResourceImpl.load(EclipseLinkResourceImpl.java:405)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:255)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:270)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
> at com.mycompany.myplugin.reporting.event.util.EventUtils.loadDatabase(EventUtils.java:164)
> at
> com.mycompany.myplugin.reporting.eventcontroller.impl.EventModelControllerImpl.loadPersistence(EventModelControllerImpl.java:114)
>
> at com.mycompany.myplugin.reporting.eventcontroller.impl.EventModelControllerImpl.<init>(EventModelControllerImpl.java:42)
> at
> com.mycompany.myplugin.reporting.eventcontroller.impl.EventModelControllerImpl$$FastClassByGuice$$62e0f41b.newInstance(<generated>)
>
> at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
> at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
> at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
> at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
> at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
> at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
> at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
> at com.google.inject.Scopes$1$1.get(Scopes.java:65)
> at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
> at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:737)
> at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
> at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
> at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:75)
> at com.google.inject.internal.MembersInjectorImpl$1.call(MembersInjectorImpl.java:73)
> at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
> at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:73)
> at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:60)
> at com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:944)
> at com.mycompany.myplugin.ioc.IocPlugin.injectMembers(IocPlugin.java:80)
> at com.mycompany.myplugin.audit.util.ReportingHandler.<init>(ReportingHandler.java:35)
> at com.mycompany.myplugin.audit.view.AuditView$2.<init>(AuditView.java:115)
> at com.mycompany.myplugin.audit.view.AuditView.createPartControl(AuditView.java:115)
> [...]
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
> at com.mycompany.myplugin.ssm.product.SSMApplication.start(SSMApplication.java:26)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
> 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(EclipseStarter.java:344)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
> Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.jpa.osgi.PersistenceProvider
> at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> ... 88 more
>
> And here is my plug-in Manifest.mf file :
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: %Bundle-Name
> Bundle-SymbolicName: com.mycompany.myplugin.reporting;singleton:=true
> Bundle-Version: 0.1.0.qualifier
> Bundle-Activator: com.mycompany.myplugin.reporting.ReportPlugin
> Bundle-Vendor: %Bundle-Vendor
> Require-Bundle: com.google.guice,
> com.mysql.jdbc,
> com.mycompany.myplugin.logging,
> javax.annotation,
> javax.persistence;bundle-version="1.99.0",
> org.apache.commons.logging,
> org.eclipse.core.runtime,
> org.eclipse.emf.ecore,
> org.eclipse.emf.ecore.xmi,
> org.eclipse.emf.teneo.orm,
> org.eclipse.emf.teneo.eclipselink,
> org.eclipse.persistence.jpa;bundle-version="2.3.1"
> Bundle-RequiredExecutionEnvironment: JavaSE-1.6
> Bundle-ActivationPolicy: lazy
> Export-Package: com.mycompany.myplugin.reporting,
> com.mycompany.myplugin.reporting.event,
> com.mycompany.myplugin.reporting.event.impl,
> com.mycompany.myplugin.reporting.event.util,
> com.mycompany.myplugin.reporting.eventcontroller,
> com.mycompany.myplugin.reporting.message,
> com.mycompany.myplugin.reporting.syslog
>
> Hopefully, this problem is not a real one and i just missed some configuration thing. Otherwise, any help would be
> greatly appreciated.
>
> Regards,
> Mathieu


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #816189 is a reply to message #815925] Thu, 08 March 2012 14:36 Go to previous messageGo to next message
Mathieu Guillet is currently offline Mathieu GuilletFriend
Messages: 2
Registered: March 2012
Location: France
Junior Member
Hi Martin,

you were right, that was a matter of EclipseLink plugin version. I was using v2.3.1 in which the package org.eclipse.persistence.jpa.osgi has its own plug-in, whereas in v2.0.x this package is in the same plugin as the rest of org.eclipse.persistence.jpa packages.

Anyway, you put me on the right way, and now it works! (well, at least, i've got different errors now Smile

For the record, if one use org.eclipse.emf.teneo plugin in version 1.1.2 and org.eclipse.emf.teneo.eclipselink in version 1.0.0, one'd better use eclipselink plugins in version 2.0.x.

Thanks again, Martin.

Best regards,
Mathieu
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #872071 is a reply to message #815925] Tue, 15 May 2012 12:09 Go to previous messageGo to next message
Chris Boerger is currently offline Chris BoergerFriend
Messages: 21
Registered: March 2012
Junior Member
> Hi Mathieu,
> Hmm, not sure where this is coming from, in an earlier version of eclipselink I know that this class was in another (the
> main eclipselink) plugin and I think in 3.7 it was moved to this separate plugin.
>
> Afaik the problem/solution is not in the source code but in the dependency definition of your plugin. Can you validate
> the plugin dependencies (there is an option in the manifest.mf editor to do that)?
> Is this jpa osgi plugin listed always together with the main org.eclipse.persistence.jpa plugin in all dependencies?
>
> gr. Martin

Martin,

I'm currently running Eclipse 3.7 with Eclipselink 2.3.2 and can get the same error message using the examples library. (org.eclipse.emf.teneo.eclipselink.examples.library.orm.tests.EclipseLinkResourceTest) I'm using Teneo 1.2.0 from the nightly builds.

You are correct that the PersistenceProvider has been moved to another plugin, org.eclipse.persistence.jpa.osgi. org.eclipse.emf.teneo.eclipselink, however, points only to jpa and not jpa.osgi in the manifest.

Chris Boerger
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #872086 is a reply to message #872071] Tue, 15 May 2012 12:33 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mathieu,
I recently spend some time on this and the honest answer is that the EMF EclipseLink integration works for Helios/3.6
but does not work for 3.7/Indigo.
The EMF-EclipseLink integration is not actively supported afaik. So I am pretty sure no-one will spend time on upgrading
this integration in the near/foreseeable future (if ever)... unless it gets sponsored in some mayor way...

Sorry to bring the bad news...

So you have 2 options:
- use Teneo Hibernate
- use Texo (http://wiki.eclipse.org/Texo) which is being tested on EclipseLink but works equally fine for other ORM's
(as it generates true generic/standard compliant JPA)

Note that Texo recently moved into the RCP space also:
http://martintaal.wordpress.com/2012/05/09/emft-texo-model-driven-rcp-using-texo-generated-jpa-entities/

gr. Martin

On 05/15/2012 02:09 PM, Chris Boerger wrote:
>> Hi Mathieu,
>> Hmm, not sure where this is coming from, in an earlier version of eclipselink I know that this class was in another (the
>> main eclipselink) plugin and I think in 3.7 it was moved to this separate plugin.
>>
>> Afaik the problem/solution is not in the source code but in the dependency definition of your plugin. Can you validate
>> the plugin dependencies (there is an option in the manifest.mf editor to do that)?
>> Is this jpa osgi plugin listed always together with the main org.eclipse.persistence.jpa plugin in all dependencies?
>>
>> gr. Martin
>
> Martin,
>
> I'm currently running Eclipse 3.7 with Eclipselink 2.3.2 and can get the same error message using the examples library.
> (org.eclipse.emf.teneo.eclipselink.examples.library.orm.tests.EclipseLinkResourceTest) I'm using Teneo 1.2.0 from the
> nightly builds.
>
> You are correct that the PersistenceProvider has been moved to another plugin, org.eclipse.persistence.jpa.osgi.
> org.eclipse.emf.teneo.eclipselink, however, points only to jpa and not jpa.osgi in the manifest.
>
> Chris Boerger


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #874152 is a reply to message #815456] Sun, 20 May 2012 04:14 Go to previous message
Chris Boerger is currently offline Chris BoergerFriend
Messages: 21
Registered: March 2012
Junior Member
Matthieu,

I wanted to point you to this bugzilla report that someone already posted for this problem:

(I can't post links yet! Sorry! But if you go into the Eclipse bugzilla and search for id=353353 you'll find it.)
bugs.eclipse.org / bugs / show_bug.cgi?id=353353

I took the diff that Csaba provided and applied it to the teneo.eclipselink plugin and it now works perfectly for me.

Chris
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #874154 is a reply to message #815456] Sun, 20 May 2012 04:14 Go to previous message
Chris Boerger is currently offline Chris BoergerFriend
Messages: 21
Registered: March 2012
Junior Member
Matthieu,

I wanted to point you to this bugzilla report that someone already posted for this problem:

(I can't post links yet! Sorry! But if you go into the Eclipse bugzilla and search for id=353353 you'll find it.)
bugs.eclipse.org / bugs / show_bug.cgi?id=353353

I took the diff that Csaba provided and applied it to the teneo.eclipselink plugin and it now works perfectly for me.

Chris
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #874156 is a reply to message #815456] Sun, 20 May 2012 04:14 Go to previous message
Chris Boerger is currently offline Chris BoergerFriend
Messages: 21
Registered: March 2012
Junior Member
Matthieu,

I wanted to point you to this bugzilla report that someone already posted for this problem:

(I can't post links yet! Sorry! But if you go into the Eclipse bugzilla and search for id=353353 you'll find it.)
bugs.eclipse.org / bugs / show_bug.cgi?id=353353

I took the diff that Csaba provided and applied it to the teneo.eclipselink plugin and it now works perfectly for me.

Chris
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #874158 is a reply to message #815456] Sun, 20 May 2012 04:14 Go to previous message
Chris Boerger is currently offline Chris BoergerFriend
Messages: 21
Registered: March 2012
Junior Member
Matthieu,

I wanted to point you to this bugzilla report that someone already posted for this problem:

(I can't post links yet! Sorry! But if you go into the Eclipse bugzilla and search for id=353353 you'll find it.)
bugs.eclipse.org / bugs / show_bug.cgi?id=353353

I took the diff that Csaba provided and applied it to the teneo.eclipselink plugin and it now works perfectly for me.

Chris
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #874160 is a reply to message #815456] Sun, 20 May 2012 04:14 Go to previous message
Chris Boerger is currently offline Chris BoergerFriend
Messages: 21
Registered: March 2012
Junior Member
Matthieu,

I wanted to point you to this bugzilla report that someone already posted for this problem:

(I can't post links yet! Sorry! But if you go into the Eclipse bugzilla and search for id=353353 you'll find it.)
bugs.eclipse.org / bugs / show_bug.cgi?id=353353

I took the diff that Csaba provided and applied it to the teneo.eclipselink plugin and it now works perfectly for me.

Chris
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #874162 is a reply to message #815456] Sun, 20 May 2012 04:14 Go to previous message
Chris Boerger is currently offline Chris BoergerFriend
Messages: 21
Registered: March 2012
Junior Member
Matthieu,

I wanted to point you to this bugzilla report that someone already posted for this problem:

(I can't post links yet! Sorry! But if you go into the Eclipse bugzilla and search for id=353353 you'll find it.)
bugs.eclipse.org / bugs / show_bug.cgi?id=353353

I took the diff that Csaba provided and applied it to the teneo.eclipselink plugin and it now works perfectly for me.

Chris
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #874164 is a reply to message #815456] Sun, 20 May 2012 04:14 Go to previous message
Chris Boerger is currently offline Chris BoergerFriend
Messages: 21
Registered: March 2012
Junior Member
Matthieu,

I wanted to point you to this bugzilla report that someone already posted for this problem:

(I can't post links yet! Sorry! But if you go into the Eclipse bugzilla and search for id=353353 you'll find it.)
bugs.eclipse.org / bugs / show_bug.cgi?id=353353

I took the diff that Csaba provided and applied it to the teneo.eclipselink plugin and it now works perfectly for me.

Chris
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #874166 is a reply to message #815456] Sun, 20 May 2012 04:14 Go to previous message
Chris Boerger is currently offline Chris BoergerFriend
Messages: 21
Registered: March 2012
Junior Member
Matthieu,

I wanted to point you to this bugzilla report that someone already posted for this problem:

(I can't post links yet! Sorry! But if you go into the Eclipse bugzilla and search for id=353353 you'll find it.)
bugs.eclipse.org / bugs / show_bug.cgi?id=353353

I took the diff that Csaba provided and applied it to the teneo.eclipselink plugin and it now works perfectly for me.

Chris
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #874168 is a reply to message #815456] Sun, 20 May 2012 04:14 Go to previous message
Chris Boerger is currently offline Chris BoergerFriend
Messages: 21
Registered: March 2012
Junior Member
Matthieu,

I wanted to point you to this bugzilla report that someone already posted for this problem:

(I can't post links yet! Sorry! But if you go into the Eclipse bugzilla and search for id=353353 you'll find it.)
bugs.eclipse.org / bugs / show_bug.cgi?id=353353

I took the diff that Csaba provided and applied it to the teneo.eclipselink plugin and it now works perfectly for me.

Chris
Re: [ EMF / Teneo / EclipseLink ] ClassLoading issue with JPA osgi PersistenceProvider [message #874171 is a reply to message #815456] Sun, 20 May 2012 04:14 Go to previous message
Chris Boerger is currently offline Chris BoergerFriend
Messages: 21
Registered: March 2012
Junior Member
Matthieu,

I wanted to point you to this bugzilla report that someone already posted for this problem:

(I can't post links yet! Sorry! But if you go into the Eclipse bugzilla and search for id=353353 you'll find it.)
bugs.eclipse.org / bugs / show_bug.cgi?id=353353

I took the diff that Csaba provided and applied it to the teneo.eclipselink plugin and it now works perfectly for me.

Chris
Previous Topic:[CDO] CDOQuery and local changes
Next Topic:EMF Teneo 2.0: support for JPA 2.0 and Hibernate 4.1
Goto Forum:
  


Current Time: Sat Apr 27 03:38:32 GMT 2024

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

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

Back to the top