|Gemini JPA messes around with OSGI startup sequence [message #1046763]
||Mon, 22 April 2013 10:37
| Kees Pieters
Registered: July 2009
I have an RCP application that is configured with the following bundles:|
-bundle RCP: is an Application that references services registered by bundle SERVICES. It holds dependencies to both SERVICES and PERSISTENCE
-bundle SERVICES: defines blueprint services and references a MANDATORY persistency service, bundle PERSISTENCE. It holds dependencies to PERSISTENCE.
-bundle PERSISTENCE: registers a gemini blueprint JPA service
Sometimes it works (which leads me to believe that the configurations in themselves are ok), but it seems very vulnerable to the applied startup sequence.
What I have found out is the following. Whenever I activate org.eclipse.gemini.jpa, it seems to do something with all the bundles in my runtime configuration. As a result, the RCP often can't startup (application id not found), which are caused by a number of exceptions:
java.lang.IllegalStateException: BundleContext is no longer valid
I THINK that the following happens:
- RCP starts up and begins to do it's thing
- org.eclipse.gemini.jpa starts up and interferes with the Application startup by stopping the relevant bundles, presumably SERVICES. A moment later SERVICES is restarted as DS takes over.
When the startup sequence is completed, and I run 'ss' in the console, everything seems fine (except for the afore mentioned exceptions). Obviously there are no startup problems when I do not activate org-eclipse.gemini.jpa (but with imaginable results...)
When I change the reference to the persistence service in SERVICES to optional, everything starts up without problems, but the services in bundle SERVICES will not have a connection to the database.
I am thinking of combining the SERVICES and PERSISTENCE bundles, which will reduce the number of steps between
RCP -> SERVICES ->PERSISTENCE -> Database (MySql)
but before doing so I would like advice from the community...I don't think the approach is that exotic, and there is still a vulnerability between the JPA startup and an RCP application startup.
Am I dealing with a JPA bug here, a runtime configuration issue, or is something else happening.
Powered by FUDForum
. Page generated in 0.02084 seconds