Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » [gemini jpa] Gemini JPA in an OSGI service
[gemini jpa] Gemini JPA in an OSGI service [message #701027] Sun, 24 July 2011 13:17 Go to next message
Karsten Voigt is currently offline Karsten VoigtFriend
Messages: 19
Registered: July 2011
Junior Member
Hi,

I have an application (RAP) that uses eclipse link without any major issues. Now I'd like to change my implementation to use gemini jpa (without dbaccess). All my persistence actions and entities are part of a custom bundle that provides an OSGI service (declarative). How can this service access the EntityManagerFactory?

I downloaded gemini jpa and added the two jars to my target platform. I also removed the org.eclipse.persistence.jpa.osgi bundle. Now I start my application and type ls to see all available services, but no EntityManagerFactory is there. Shouldn't there be a registered service per punit? (Also getting a service reference from the bundle context using the EntityManagerFactory.class is no successful.)

Maybe I got something wrong. Any help is welcome.

Thanks.

Karsten
Re: [gemini jpa] Gemini JPA in an OSGI service [message #701725 is a reply to message #701027] Mon, 25 July 2011 13:46 Go to previous messageGo to next message
Michael Keith is currently offline Michael KeithFriend
Messages: 243
Registered: July 2009
Senior Member
Hi Karsten,

I just noticed that the Gemini JPA tests all assume DBAccess so it's possible that support for accessing the driver directly got broken along the way somewhere. While I check on this and add a proper test for it, perhaps you can give some more details about the versions you are using and the arch of your app, etc? Could you please indicate:

- version of EclipseLink you are using
- version of Gemini JPA
- an idea of the relevant bundles in the system and what is in them:
- the client bundle (trying to access the EMF)
- where your JDBC driver is configured/bundled
- where your entities and persistence.xml are bundled

I'm sure we'll be able to get you going before too long Smile

Thanks!

-Mike
Re: [gemini jpa] Gemini JPA in an OSGI service [message #724857 is a reply to message #701725] Tue, 13 September 2011 11:09 Go to previous messageGo to next message
Nepomuk Seiler is currently offline Nepomuk SeilerFriend
Messages: 88
Registered: December 2010
Member
Hi,

I got a similar issue. Currently I'm using
* DBAccess RC1
* Gemini JPA RC1
* EclipseLink 2.3.0
* Eclipse 3.6.2

I have a declarative service and I'm defining a service reference to "EntityManagerFactoryBuilder". On startup this message comes up:

Quote:

!ENTRY de.lmu.ifi.dbs.medmon.medic.core 4 0 2011-09-13 13:00:46.214
!MESSAGE [SCR] Error while trying to bind reference Reference[name = EntityManagerFactoryBuilder, interface = org.osgi.service.jpa.EntityManagerFactoryBuilder, policy = static, cardinality = 0..n, target = null, bind = bindEntityManagerFactoryBuilder, unbind = unbindEntityManagerFactoryBuilder]
Details:
Problematic reference = Reference[name = EntityManagerFactoryBuilder, interface = org.osgi.service.jpa.EntityManagerFactoryBuilder, policy = static, cardinality = 0..n, target = null, bind = bindEntityManagerFactoryBuilder, unbind = unbindEntityManagerFactoryBuilder]
of service component = de.lmu.ifi.dbs.medmon.medic.core.SensorService
component implementation class = de.lmu.ifi.dbs.medmon.medic.core.sensor.SensorService
located in bundle with symbolic name = de.lmu.ifi.dbs.medmon.medic.core
bundle location = reference:file:/home/muki/Development/workspace_medmon/Medmon/de.lmu.ifi.dbs.medmon.medic.core/


What does this "problematic reference" mean? I'm trying to change to the newer versions (Eclipse 3.7, DBAccess RC1, Gemini JPA RC3) and report if the error still occurs.

cheers,
Muki
Re: [gemini jpa] Gemini JPA in an OSGI service [message #724895 is a reply to message #701725] Tue, 13 September 2011 12:57 Go to previous messageGo to next message
Nepomuk Seiler is currently offline Nepomuk SeilerFriend
Messages: 88
Registered: December 2010
Member
Hi,

It works fine with the EntityManagerFactoryBuilder, however there's no EntityManagerFactory?! When I look via "services" in the OSGi console, I can only find EntityManagerFactoryBuilder and org.osgi.service.jdbc.DataSourceFactory (4x, two EmbeddedDriver, two clientDriver). However I can connect to the database!

My configuration

- Eclipse 3.7.0
- EclipseLink 2.3.0
- Gemini JPA 1.0.0.RC3
- Gemini DBAccess 1.0.0.RC2
- osgi.enterprise_4.2.0

My declarative service is located in another bundle, than the model and the PU.

cheers,
Muki

[Updated on: Tue, 13 September 2011 12:58]

Report message to a moderator

Re: [gemini jpa] Gemini JPA in an OSGI service [message #725496 is a reply to message #724895] Thu, 15 September 2011 00:30 Go to previous messageGo to next message
Michael Keith is currently offline Michael KeithFriend
Messages: 243
Registered: July 2009
Senior Member
Does the EMF get registered later on after everything has been started and settled down? If so then it is possible that the DataSourceFactory is not registered by DBAccess until after Gemini starts processing the persistence bundle. If the start order ends up causing the Gemini bundle to get started before the DBAccess bundle then the DSF will not be there yet, and if there is no DSF when Gemini processes the persistence unit then Gemini will not register an EMF but go ahead and register an EMFBuilder.

In any case, set the debug flag by adding the GEMINI_DEBUG system property to the Java command line:
java -DGEMINI_DEBUG=true

This should help you to see what is happening.
Re: [gemini jpa] Gemini JPA in an OSGI service [message #725618 is a reply to message #725496] Thu, 15 September 2011 11:10 Go to previous message
Nepomuk Seiler is currently offline Nepomuk SeilerFriend
Messages: 88
Registered: December 2010
Member
Hi,

Thanks for the debugging hint. It was a silly fault Sad, didn't give any JDBC driver class in the
persistence.xml.

-Muki
Previous Topic:Gemini Web Maya (2.0) Download Available
Next Topic:Establish Connection using sql server with eclipse Helios
Goto Forum:
  


Current Time: Thu Apr 25 01:35:25 GMT 2024

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

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

Back to the top