[jboss-osgi-issues] [JBoss JIRA] (JBOSGI-748) EntityManagerFactory doesn't get registered for Persistence Bundles

Thomas Diesler (JIRA) jira-events at lists.jboss.org
Thu Oct 10 07:07:02 EDT 2013


     [ https://issues.jboss.org/browse/JBOSGI-748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Diesler updated JBOSGI-748:
----------------------------------

    Assignee:     (was: Thomas Diesler)

    
> EntityManagerFactory doesn't get registered for Persistence Bundles
> -------------------------------------------------------------------
>
>                 Key: JBOSGI-748
>                 URL: https://issues.jboss.org/browse/JBOSGI-748
>             Project: JBoss OSGi
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: jpa
>    Affects Versions: JBossOSGi 2.1.0
>         Environment: linux version 3.8.0-31
> java version "1.7.0_25" OpenJDK
> wildfly-8.0.0.Alpha4
> jboss-osgi-2.1.0
>            Reporter: Umberto Cappellini
>
> If I deploy a persistence bundle (i.e. a bundle having a META-INF/persistence.xml, and relative <Meta-Persistence> tag in the manifest), the framework correctly exposes EntityManagerFactory OSGi service.
> Two Problems:
> A) At startup, the em service is not anymore exposed. I found this happens because the persistence bundle starts up before the PersistenceUnitProcessor is registered as BundleListener, and therefore it doesn't receive the event START. 
> If I set "org.jboss.osgi" log level to TRACE, the time lost to trace logs is enough for the framework to  start up properly and register the listener. In this case the event is received and the em service registered.
> This is reproducible all the times: put the log level to INFO or DEBUG and no em service, put it to TRACE, and you have the service.
> B) If I install the persistence bundle in the "bundle" folder of Wildfly and reference it as capability in the OSGi subsystem, the method PersistenceUnitProcessor.deploy is never invoked, and therefore the em service never exposed. 
> *edit*
> OSGi Enterprise 5 standard requires the JPA provider to always expose the emf service for each persistence bundle: «A JPA Provider must register an Entity Manager Factory service for each assigned Persistence Unit that is complete. Complete means that it is a configured Persistence Unit, including the reference to the relational database.»

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the jboss-osgi-issues mailing list