3 Replies Latest reply on Feb 12, 2015 12:19 PM by Ian Page

    Bundle persistence.xml not being detected on Fuse 6.1 restart

    Jakub Korab Newbie

      Hi all,


      I am trying to get a JPA persistence bundle running reliably in Fuse 6.1. The bundle contains a META-INF/persistence.xml, and has a Meta-Persistence directive in the bundle manifest.


      My bundle is part of a feature that has the following dependencies:


      <feature name="my-persistence" version="1.0">

        <feature version="1.0">my-datasource</feature>

        <feature version="[2.12.0,3)">camel-jpa</feature>

        <feature version="[4.5,5)">jpa-hibernate</feature>




      All pretty straightforward.


      I have bumped the logging level for org.apache.aries.jpa.container to DEBUG.


      When I install the feature, I see the following log output:


      16:38:25,309 | DEBUG | l Console Thread | container | 269 - org.apache.aries.jpa.container - 1.0.1.redhat-610379 | Located Persistence descriptors: [META-INF/persistence.xml] in bundle my-persistence_1.0.0.SNAPSHOT


      The bundle headers are as follows:


      my-persistence (282)


      Manifest-Version = 1.0

      Bnd-LastModified = 1422290971028

      Tool = Bnd-1.50.0

      Meta-Persistence = META-INF/persistence.xml


      Bundle-Name = my-persistence

      Bundle-SymbolicName = my-persistence

      Bundle-Version = 1.0.0.SNAPSHOT

      Bundle-ManifestVersion = 2


      Import-Package =





      Export-Package =





      The persistence bundle is in the [Created] state, and shows a javax.persistence.EntityManagerFactory service as being registered.


      my-persistence (282) provides:


      objectClass = javax.persistence.EntityManagerFactory

      org.apache.aries.jpa.container.managed = true

      org.apache.aries.jpa.default.unit.name = false

      osgi.unit.name = hibernate.h2.karaf

      osgi.unit.provider = org.hibernate.ejb.HibernatePersistence

      osgi.unit.version = 1.0.0.SNAPSHOT

      service.id = 602


      So far, so good.


      When I restart the container, no such log output appears. Instead the bundle is in the [Active] state, with no resistered services.


      Any ideas would be appreciated.