Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » org.eclipse.gemini.dbaccess.derby bundle does not start(trouble to have the org.eclipse.gemini.dbaccess.samples working on Derby)
org.eclipse.gemini.dbaccess.derby bundle does not start [message #1426130] Thu, 18 September 2014 09:35 Go to next message
David Mising name is currently offline David Mising nameFriend
Messages: 24
Registered: June 2010
Junior Member
Hello there,

I am strggling to have the sample come with Gemini JPA DBaccess working in a standalone Equinox LunaRC4 runtime.

The org.eclipse.gemini.dbaccess.samples started fine; but both "org.eclipse.gemini.dbaccess.derby" and "org.eclipse.gemini.dbaccess.util" bundle stay in "Starting" state (due to a lazy start). That means no DataSourceFactory is registered. What have I missed here? should I register my own DataSourceFactory?

I have Gemini JPA 1.1, EclipaseLink 2.4.2, osgi.enterprise installed and started ...

Thanks a lot,
David
Re: org.eclipse.gemini.dbaccess.derby bundle does not start [message #1426181 is a reply to message #1426130] Thu, 18 September 2014 11:06 Go to previous messageGo to next message
Sebastian Lorenz is currently offline Sebastian LorenzFriend
Messages: 42
Registered: November 2010
Member
Have you set org.eclipse.gemini.dbaccess.derby to autostart=true.

No bundle has a dependency to the dbaccess.derby bundle to avoid dependencies to a database vendor in the code. Therefore the dbaccess.derby bundle won't be started if not set to autostart.
The Derby Driver is registered by the dbaccess.derby bundle in its Activator. If the Activator runs it registers the DataSourceFactory.
Re: org.eclipse.gemini.dbaccess.derby bundle does not start [message #1426256 is a reply to message #1426181] Thu, 18 September 2014 13:26 Go to previous messageGo to next message
David Mising name is currently offline David Mising nameFriend
Messages: 24
Registered: June 2010
Junior Member
Thanks a lot!

However, now I see this error (there is not stack trace printed from sample). org.apache.derby bundle is started; and the connection string is "jdbc:derby:testDB;create=true". ... Have you seen this before?

[org.eclipse.osgi:1411043920282] FrameworkEvent STARTLEVEL CHANGED
===== Sample Gemini DBAccess Client starting
===== Sample Gemini DBAccess client notified of service: org.apache.derby.jdbc.EmbeddedDriver
===== Sample Gemini DBAccess client - Error creating or using data source: java.sql.SQLException: Failed to start databa
se 'testDB' with class loader org.eclipse.osgi.internal.loader.EquinoxClassLoader@b0418bdc[org.apache.derby:10.8.2.2(id=
19)], see the next exception for details.
Re: org.eclipse.gemini.dbaccess.derby bundle does not start [message #1426266 is a reply to message #1426256] Thu, 18 September 2014 13:43 Go to previous messageGo to next message
Sebastian Lorenz is currently offline Sebastian LorenzFriend
Messages: 42
Registered: November 2010
Member
What does the stacktrace say? I would assume that the database cannot be created in the current directory. Change the JDBC_URL in DataSourceClientExample.class to e.g. "jdbc:derby:/c/temp/testDB;create=true"
Re: org.eclipse.gemini.dbaccess.derby bundle does not start [message #1426305 is a reply to message #1426266] Thu, 18 September 2014 14:46 Go to previous messageGo to next message
David Mising name is currently offline David Mising nameFriend
Messages: 24
Registered: June 2010
Junior Member
Thanks again!! I wrote my own service tracker to configure the DataSource to a network derby; and it connected. Big step.

Now I want to have the "org.eclipse.gemini.jpa.sample.basic-1.1.0" sample come with gemini-jpa-1.1.0 to work on Derby. Following the guide, I installed and started "org.eclipse.gemini.jpa.sample.basic-1.1.0.RELEASE.jar"; but I got same NoClassDefFoundError as mentioned in this question "https://www.eclipse.org/forums/index.php/t/813770/". (I had the earlier error when trying on a PostgreSQL).

Have you seen this error before? or I missed some steps? ... thanks a lot!!
Re: org.eclipse.gemini.dbaccess.derby bundle does not start [message #1426310 is a reply to message #1426305] Thu, 18 September 2014 14:53 Go to previous messageGo to next message
David Mising name is currently offline David Mising nameFriend
Messages: 24
Registered: June 2010
Junior Member
I just installed 3 org.eclipse.gemini.jpa.sample.configadmin jars. Started them in this order, configadmin.pu -> configadmin -> configadmin.gen. I got same NoClassDefFoundError. Following is the stack trace ... Have someone seen this before? thanks!!!

...
[EL Config]: metadata: ServerSession(1290713144)--The foreign key column name for the mapping element [library] is being
defaulted to: LIBRARY_ID.
[EL Config]: metadata: ServerSession(1290713144)--The key column name for the basic map mapping element [books] is being
defaulted to: BOOKS_KEY.
[EL Severe]: ejb: ServerSession(1290713144)--java.lang.NoClassDefFoundError: org.eclipse.persistence.internal.jpa.rs.met
adata.model.Link
at java.lang.Class.getDeclaredMethodsImpl(Native Method)
at java.lang.Class.getDeclaredMethods(Class.java:861)
at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getDeclaredMethods(PrivilegedAccessHelper.ja
va:324)
at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListenerMetadata.getDeclaredMethods(EntityListe
nerMetadata.java:255)
at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityClassListenerMetadata.process(EntityClassListen
erMetadata.java:89)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processListeners(EntityAccesso
r.java:1071)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.addEntityListeners(MetadataProcessor.java:134
)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:481)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDele
gate.java:186)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactor
yDelegate.java:278)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImp
l.java:304)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.ja
va:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:619)
at org.eclipse.gemini.jpa.proxy.EMFServiceProxyHandler.invoke(EMFServiceProxyHandler.java:75)
at com.sun.proxy.$Proxy15.createEntityManager(Unknown Source)
at client.LibraryClient.run(LibraryClient.java:35)
at client.Activator.addingService(Activator.java:66)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java
:109)
at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:
862)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
at org.eclipse.gemini.jpa.ServicesUtil.tryToRegisterEMFService(ServicesUtil.java:227)
at org.eclipse.gemini.jpa.configadmin.ConfigAdminListener.refreshPersistenceUnitIfNecessary(ConfigAdminListener.
java:287)
at org.eclipse.gemini.jpa.configadmin.ConfigAdminListener.updated(ConfigAdminListener.java:157)
at org.eclipse.equinox.internal.cm.ManagedServiceFactoryTracker$2.run(ManagedServiceFactoryTracker.java:283)
at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36)
Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.internal.jpa.rs.metadata.model.Link cannot be found
by org.eclipse.gemini.jpa.sample.configadmin.pu_1.1.0.RELEASE
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:827)
... 39 more

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:619)
at org.eclipse.gemini.jpa.proxy.EMFServiceProxyHandler.invoke(EMFServiceProxyHandler.java:75)
at com.sun.proxy.$Proxy15.createEntityManager(Unknown Source)
at client.LibraryClient.run(LibraryClient.java:35)
at client.Activator.addingService(Activator.java:66)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java
:109)
at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:
862)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
at org.eclipse.gemini.jpa.ServicesUtil.tryToRegisterEMFService(ServicesUtil.java:227)
at org.eclipse.gemini.jpa.configadmin.ConfigAdminListener.refreshPersistenceUnitIfNecessary(ConfigAdminListener.
java:287)
at org.eclipse.gemini.jpa.configadmin.ConfigAdminListener.updated(ConfigAdminListener.java:157)
at org.eclipse.equinox.internal.cm.ManagedServiceFactoryTracker$2.run(ManagedServiceFactoryTracker.java:283)
at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36)
Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.4.2.v
20130514-5956486): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Deployment of PersistenceUnit [Library] failed. Close all factories for this PersistenceUnit.
Internal Exception: java.lang.NoClassDefFoundError: org.eclipse.persistence.internal.jpa.rs.metadata.model.Link
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createDeployFailedPersistenceException(EntityMana
gerSetupImpl.java:628)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:608)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDele
gate.java:186)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactor
yDelegate.java:278)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImp
l.java:304)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.ja
va:282)
... 27 more
Caused by: Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.4.2.v20130514-5956486): org.eclipse.persisten
ce.exceptions.EntityManagerSetupException
Exception Description: Deployment of PersistenceUnit [Library] failed. Close all factories for this PersistenceUnit.
Internal Exception: java.lang.NoClassDefFoundError: org.eclipse.persistence.internal.jpa.rs.metadata.model.Link
at org.eclipse.persistence.exceptions.EntityManagerSetupException.deployFailed(EntityManagerSetupException.java:
229)
... 33 more
Caused by: java.lang.NoClassDefFoundError: org.eclipse.persistence.internal.jpa.rs.metadata.model.Link
at java.lang.Class.getDeclaredMethodsImpl(Native Method)
at java.lang.Class.getDeclaredMethods(Class.java:861)
at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getDeclaredMethods(PrivilegedAccessHelper.ja
va:324)
at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListenerMetadata.getDeclaredMethods(EntityListe
nerMetadata.java:255)
at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityClassListenerMetadata.process(EntityClassListen
erMetadata.java:89)
at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processListeners(EntityAccesso
r.java:1071)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.addEntityListeners(MetadataProcessor.java:134
)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:481)
... 31 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.internal.jpa.rs.metadata.model.Link cannot be found
by org.eclipse.gemini.jpa.sample.configadmin.pu_1.1.0.RELEASE
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:827)
... 39 more
[org.eclipse.gemini.jpa.sample.configadmin:1411051742409] FrameworkEvent ERROR
java.lang.NullPointerException
Re: org.eclipse.gemini.dbaccess.derby bundle does not start [message #1460976 is a reply to message #1426310] Tue, 04 November 2014 04:36 Go to previous messageGo to next message
Fernando Paz is currently offline Fernando PazFriend
Messages: 20
Registered: May 2014
Junior Member
Hey guys, I'm struggling with the same issue. When I run my RCP application, my bundles' statuses are not as expected:

135	STARTING    org.eclipse.gemini.dbaccess.h2_1.1.0.RELEASE
136	STARTING    org.eclipse.gemini.dbaccess.util_1.1.0.RELEASE
137	RESOLVED    org.eclipse.gemini.jpa_1.2.0.M1
155	RESOLVED    org.h2_1.3.176


I also tried to enable auto start for them in my product file, but no success:

      <plugin id="org.eclipse.gemini.dbaccess.h2" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.gemini.dbaccess.util" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.gemini.jpa" autoStart="true" startLevel="0" />


If I manually start them using Eclipse's built-in OSGi console, everything works properly. What am I missing here?

Also, I'd like to make the EntityManagerFactory service available through DS, but this is not working either. Is there any other way without using the service lookup approach from the examples?

Thanks in advance.
Re: org.eclipse.gemini.dbaccess.derby bundle does not start [message #1461826 is a reply to message #1460976] Wed, 05 November 2014 00:35 Go to previous messageGo to next message
Fernando Paz is currently offline Fernando PazFriend
Messages: 20
Registered: May 2014
Junior Member
Actually, if I start manually only the org.eclipse.gemini.jpa_1.2.0.M1 bundle, it works. What do I need to do to make it start automatically when I run my product?
Re: org.eclipse.gemini.dbaccess.derby bundle does not start [message #1462077 is a reply to message #1461826] Wed, 05 November 2014 07:14 Go to previous messageGo to next message
Sebastian Lorenz is currently offline Sebastian LorenzFriend
Messages: 42
Registered: November 2010
Member
Hi,

I've got the following start levels in my application (and it works):

<plugin id="javax.persistence" autoStart="true" startLevel="1" />
<plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.gemini.blueprint.extender" autoStart="true" startLevel="3" />
<plugin id="org.eclipse.gemini.jpa" autoStart="true" startLevel="3" />
<plugin id="org.h2" autoStart="true" startLevel="1" />

Hope this helps.
Regards Sebastian

[Updated on: Wed, 05 November 2014 07:16]

Report message to a moderator

Re: org.eclipse.gemini.dbaccess.derby bundle does not start [message #1462641 is a reply to message #1462077] Wed, 05 November 2014 20:10 Go to previous message
Fernando Paz is currently offline Fernando PazFriend
Messages: 20
Registered: May 2014
Junior Member
Hello Sebastian.

Thanks for the code snippet. I tried the same start levels, but still no success. I suspect that I'm missing something in Eclipse. In my Run Configuration, if I don't use features and set the plug-ins' start levels individually, it works fine. Have you ever tried this using features?

Cheers,
Previous Topic:Gemini VS Eclipse Link
Next Topic:Gemini Naming 1.0.4.RELEASE is now available
Goto Forum:
  


Current Time: Tue Sep 18 17:36:36 GMT 2018

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

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

Back to the top