title: Karaf 4.0.0 M2 and Hibernate 4.3.6.Final
body: <p>I am trying to use Hibernate 4.3.6.Final with Karaf 4.0.0 M2 and MySQL v5.1.35, but getting the following error:</p>
  
  <pre><code>karaf@root()&gt; log:display
  2015-06-05 11:14:32,068 | WARN  | nsole user karaf | container                        | 120 - org.apache.aries.jpa.container - 1.0.2 | There are no suitable providers for the provider class name org.hibernate.jpa.HibernatePersistenceProvider and version range null to support the bundle leonard-orm-native/1.0.0.
  2015-06-05 11:14:32,072 | WARN  | nsole user karaf | container                        | 120 - org.apache.aries.jpa.container - 1.0.2 | There are no suitable providers for the provider class name org.hibernate.jpa.HibernatePersistenceProvider and version range null to support the bundle leonard-orm-native/1.0.0.
  2015-06-05 11:14:32,073 | WARN  | nsole user karaf | container                        | 120 - org.apache.aries.jpa.container - 1.0.2 | There are no suitable providers for the provider class name org.hibernate.jpa.HibernatePersistenceProvider and version range null to support the bundle leonard-orm-native/1.0.0.
  2015-06-05 11:14:32,078 | ERROR | nsole user karaf | aries                            | 119 - org.apache.aries.jpa.blueprint.aries - 1.0.4 | No org.apache.aries.jpa.container.sync.Synchronization service registered.
  2015-06-05 11:14:32,080 | INFO  | nsole user karaf | BlueprintContainerImpl           | 10 - org.apache.aries.blueprint.core - 1.4.2 | Bundle leonard-orm-native is waiting for dependencies [(&amp;(&amp;(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=Leonard))(objectClass=javax.persistence.EntityManagerFactory))]
  2015-06-05 11:14:32,081 | WARN  | nsole user karaf | container                        | 120 - org.apache.aries.jpa.container - 1.0.2 | There are no suitable providers for the provider class name org.hibernate.jpa.HibernatePersistenceProvider and version range null to support the bundle leonard-orm-native/1.0.0.
  2015-06-05 11:19:32,082 | ERROR | rint Extender: 3 | BlueprintContainerImpl           | 10 - org.apache.aries.blueprint.core - 1.4.2 | Unable to start blueprint container for bundle leonard-orm-native due to unresolved dependencies [(&amp;(&amp;(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=Leonard))(objectClass=javax.persistence.EntityManagerFactory))]
  </code></pre>
  
  <p>The instructions I am following to get this working can be found here:
  <a href="http://www.liquid-reality.de/display/liquid/2012/01/13/Apache+Karaf+Tutorial+Part+6+-+Database+Access" rel="nofollow">http://www.liquid-reality.de/display/liquid/2012/01/13/Apache+Karaf+Tutorial+Part+6+-+Database+Access</a></p>
  
  <p>Included in my project is the data source configuration file which Christian was kind enough to provide.</p>
  
  <p>I've done significant investigations to resolve, but feel I must be missing something very simple.  Thoughts and contributions are most welcome.</p>
  
  <p>The various files and karaf configurations are listed as follows.</p>
  
  <p>Thanks,
  Randy Leonard</p>
  
  <hr>
  
  <p>blueprint.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;blueprint default-activation="eager" xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0" xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0"
  
      xsi:schemaLocation="
              http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0 
              http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance 
              http://aries.apache.org/xmlns/jpa/v1.0.0 http://aries.apache.org/xmlns/jpa/v1.0.0 
              http://aries.apache.org/xmlns/transactions/v1.0.0 http://aries.apache.org/xmlns/transactions/v1.0.0 "&gt;
  
      &lt;bean id="personService" class="net.lr.tutorial.karaf.db.examplejpa.impl.PersonServiceImpl"&gt;
          &lt;jpa:context unitname="Leonard" property="entityManager" /&gt;
          &lt;tx:transaction method="*" value="Required" /&gt;
      &lt;/bean&gt;
  
      &lt;service ref="personService" interface="net.lr.tutorial.karaf.db.examplejpa.PersonService" /&gt;
  
      &lt;command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0"&gt;
          &lt;command name="person/add"&gt;
              &lt;action class="net.lr.tutorial.karaf.db.examplejpa.command.AddPersonCommand"&gt;
                  &lt;property name="personService" ref="personService" /&gt;
              &lt;/action&gt;
          &lt;/command&gt;
          &lt;command name="person/list"&gt;
              &lt;action class="net.lr.tutorial.karaf.db.examplejpa.command.ListPersonsCommand"&gt;
                  &lt;property name="personService" ref="personService" /&gt;
              &lt;/action&gt;
          &lt;/command&gt;
          &lt;command name="person/deleteAll"&gt;
              &lt;action class="net.lr.tutorial.karaf.db.examplejpa.command.DeleteAllPersonsCommand"&gt;
                  &lt;property name="personService" ref="personService" /&gt;
              &lt;/action&gt;
          &lt;/command&gt;
      &lt;/command-bundle&gt;
  &lt;/blueprint&gt;
  </code></pre>
  
  <p>persistence.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"&gt;
      &lt;persistence-unit name="Leonard" transaction-type="JTA"&gt;
          &lt;provider&gt;org.hibernate.jpa.HibernatePersistenceProvider&lt;/provider&gt;
          &lt;jta-data-source&gt;osgi:service/Leonard&lt;/jta-data-source&gt;
          &lt;class&gt;net.lr.tutorial.karaf.db.examplejpa.Person&lt;/class&gt;
          &lt;exclude-unlisted-classes&gt;true&lt;/exclude-unlisted-classes&gt;
          &lt;properties&gt;
              &lt;property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" /&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>And the list of bundles loaded within Karaf 4.0.0 M2</p>
  
  <pre><code>karaf@root()&gt; bundle:list
  START LEVEL 100 , List Threshold: 50
   ID | State   | Lvl | Version     | Name
  --------------------------------------------------------------------------------------
  144 | Active  |  80 | 3.2.1       | Commons Collections
  145 | Active  |  80 | 2.6         | Commons Lang
  146 | Active  |  80 | 1.6.0       | Commons Pool
  147 | Active  |  80 | 1.1.1       | geronimo-jms_1.1_spec
  152 | Active  |  80 | 1.14.1.1    | Apache ServiceMix :: Bundles :: serp
  153 | Active  |  80 | 3.16.0      | Apache XBean :: ASM 4 shaded (repackaged)
  154 | Active  |  80 | 5.1.35      | Oracle Corporation's JDBC Driver for MySQL
  155 | Active  |  80 | 0.9.0       | ClassMate
  156 | Active  |  80 | 3.18.1.GA   | Javassist
  157 | Active  |  80 | 2.0.1       | Apache Commons DBCP
  158 | Active  |  80 | 2.2.0       | Apache Commons Pool
  159 | Active  |  80 | 1.8.2.2     | Apache ServiceMix :: Bundles :: ant
  160 | Active  |  80 | 2.7.7.5     | Apache ServiceMix :: Bundles :: antlr
  161 | Active  |  80 | 3.0.0.1     | Apache ServiceMix :: Bundles :: cglib
  162 | Active  |  80 | 1.6.1.5     | Apache ServiceMix :: Bundles :: dom4j
  163 | Active  |  80 | 4.0.4.Final | hibernate-commons-annotations
  164 | Active  | 100 | 4.3.6.Final | hibernate-core
  165 | Active  | 100 | 4.3.6.Final | hibernate-entitymanager
  166 | Active  | 100 | 4.3.6.Final | hibernate-osgi
  167 | Active  |  80 | 1.2.2.Final | Java Annotation Indexer
  168 | Active  |  80 | 3.1.4.GA    | JBoss Logging 3
  169 | Active  |  80 | 1.0.2.Final | JACC 1.4 API
  170 | Active  |  80 | 0.5.0       | OPS4J Pax JDBC Config
  171 | Active  |  80 | 0.5.0       | OPS4J Pax JDBC MySQL Driver Adapter
  172 | Active  |  80 | 0.5.0       | OPS4J Pax JDBC Pooling support using Commons-DBCP2
  173 | Active  |  80 | 0.5.0       | OPS4J Pax JDBC org.osgi.service.jdbc
  174 | Active  |  80 | 1.9.0       | Apache ServiceMix :: Specs :: Stax API 1.0
  175 | Active  |  80 | 1.4         | Commons DBCP
  176 | Active  |  80 | 4.0.0.M2    | Apache Karaf :: JDBC :: Core
  189 | Failure |  80 | 1.0.0       | leonard-orm-native
  </code></pre>
  
  <p>And the list of installed features are as follows:</p>
  
  <pre><code>karaf@root()&gt; feature:list
  Name                            | Version                          | Required | Installed | Repository                        | Description
  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  transaction                     | 1.0.0                            |          |           | enterprise-4.0.0.M2               | OSGi Transaction Manager
  transaction                     | 1.0.1                            |          |           | enterprise-4.0.0.M2               | OSGi Transaction Manager
  transaction                     | 1.1.1                            | x        | x         | enterprise-4.0.0.M2               | OSGi Transaction Manager
  connector                       | 2.2.2                            |          |           | enterprise-4.0.0.M2               | OSGi support for JCA Connector 1.5
  connector                       | 3.1.1                            |          |           | enterprise-4.0.0.M2               | OSGi support for JCA Connector 1.6
  jpa                             | 2.0.0                            |          | x         | enterprise-4.0.0.M2               | OSGi Persistence Container
  jpa                             | 2.1.0                            | x        | x         | enterprise-4.0.0.M2               | OSGi Persistence Container
  openjpa                         | 2.2.2                            |          |           | enterprise-4.0.0.M2               | Apache OpenJPA 2.2.x persistence engine support
  openjpa                         | 2.3.0                            | x        | x         | enterprise-4.0.0.M2               | Apache OpenJPA 2.3.x persistence engine support
  hibernate                       | 3.3.2.GA                         |          |           | enterprise-4.0.0.M2               | Hibernate 3.x JPA persistence engine support
  hibernate                       | 4.2.15.Final                     |          |           | enterprise-4.0.0.M2               | Hibernate 4.2.x JPA persistence engine support
  hibernate-envers                | 4.2.15.Final                     |          |           | enterprise-4.0.0.M2               | Hibernate Envers 4.2.x
  hibernate                       | 4.3.6.Final                      | x        | x         | enterprise-4.0.0.M2               | Hibernate 4.3.x JPA persistence engine support
  hibernate-envers                | 4.3.6.Final                      |          |           | enterprise-4.0.0.M2               | Hibernate Envers 4.3.x
  hibernate-validator             | 5.0.3.Final                      |          |           | enterprise-4.0.0.M2               | Hibernate Validator support
  jndi                            | 4.0.0.M2                         | x        | x         | enterprise-4.0.0.M2               | OSGi Service Registry JNDI access
  jdbc                            | 4.0.0.M2                         | x        | x         | enterprise-4.0.0.M2               | JDBC service and commands
  jms                             | 4.0.0.M2                         |          |           | enterprise-4.0.0.M2               | JMS service and commands
  application-without-isolation   | 1.0.0                            | x        | x         | enterprise-4.0.0.M2               | Provide EBA archive support
  subsystems                      | 0.0.0.__aries_subsystem_version_ |          |           | enterprise-4.0.0.M2               | Support for OSGi subsystems
  cxf-specs                       | 3.0.4                            |          | x         | cxf-3.0.4                         |
  cxf-jaxb                        | 3.0.4                            |          |           | cxf-3.0.4                         |
  cxf-abdera                      | 3.0.4                            |          |           | cxf-3.0.4                         |
  wss4j                           | 2.0.3                            |          |           | cxf-3.0.4                         |
  &lt;!-- lots of cxf stuff --&gt;
  pax-jetty                       | 9.2.7.v20150116                  |          | x         | org.ops4j.pax.web-4.1.0           | Provide Jetty engine support
  pax-jetty-spdy                  | 4.1.0                            |          |           | org.ops4j.pax.web-4.1.0           | Optional additional feature to run Jetty with SPDY
  pax-http                        | 4.1.0                            |          | x         | org.ops4j.pax.web-4.1.0           | Implementation of the OSGI HTTP Service
  pax-http-whiteboard             | 4.1.0                            |          | x         | org.ops4j.pax.web-4.1.0           | Provide HTTP Whiteboard pattern support
  pax-war                         | 4.1.0                            |          | x         | org.ops4j.pax.web-4.1.0           | Provide support of a full WebContainer
  pax-war-tomcat                  | 4.1.0                            |          |           | org.ops4j.pax.web-4.1.0           | Provide support of a full WebContainer
  pax-jsf-support                 | 4.1.0                            |          |           | org.ops4j.pax.web-4.1.0           |
  pax-cdi                         | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Provide CDI support
  pax-cdi-1.1                     | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Provide CDI 1.1 support
  pax-cdi-1.2                     | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Provide CDI 1.2 support
  pax-cdi-weld                    | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Weld CDI support
  pax-cdi-1.1-weld                | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Weld CDI 1.1 support
  pax-cdi-1.2-weld                | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Weld CDI 1.2 support
  pax-cdi-openwebbeans            | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | OpenWebBeans CDI support
  pax-cdi-web                     | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Web CDI support
  pax-cdi-1.1-web                 | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Web CDI 1.1 support
  pax-cdi-1.2-web                 | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Web CDI 1.2 support
  pax-cdi-web-weld                | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Weld Web CDI support
  pax-cdi-1.1-web-weld            | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Weld Web CDI 1.1 support
  pax-cdi-1.2-web-weld            | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Weld Web CDI 1.2 support
  pax-cdi-web-openwebbeans        | 0.12.0.SNAPSHOT                  |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | OpenWebBeans Web CDI support
  deltaspike-core                 | 1.2.1                            |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Apache Deltaspike core support
  deltaspike-jpa                  | 1.2.1                            |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Apache Deltaspike jpa support
  deltaspike-partial-bean         | 1.2.1                            |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Apache Deltaspike partial bean support
  deltaspike-data                 | 1.2.1                            |          |           | org.ops4j.pax.cdi-0.12.0-SNAPSHOT | Apache Deltaspike data support
  framework-security              | 4.0.0.M2                         |          |           | standard-4.0.0.M2                 | OSGi Security for Karaf
  service-security                | 4.0.0.M2                         |          |           | standard-4.0.0.M2                 | Services Security for Karaf
  aries-proxy                     | 4.0.0.M2                         |          | x         | standard-4.0.0.M2                 | Aries Proxy
  aries-blueprint                 | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Aries Blueprint
  aries-annotation                | 4.0.0.M2                         |          |           | standard-4.0.0.M2                 | Aries Annotations
  feature                         | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Features Support
  shell                           | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Karaf Shell
  shell-compat                    | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Karaf Shell Compatibility
  deployer                        | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Karaf Deployer
  wrapper                         | 4.0.0.M2                         |          |           | standard-4.0.0.M2                 | Provide OS integration
  service-wrapper                 | 4.0.0.M2                         |          |           | standard-4.0.0.M2                 | Provide OS integration (alias to wrapper feature)
  obr                             | 4.0.0.M2                         |          | x         | standard-4.0.0.M2                 | Provide OSGi Bundle Repository (OBR) support
  bundle                          | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Provide Bundle support
  config                          | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Provide OSGi ConfigAdmin support
  diagnostic                      | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Provide Diagnostic support
  instance                        | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Provide Instance support
  jaas                            | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Provide JAAS support
  log                             | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Provide Log support
  package                         | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Package commands and mbeans
  service                         | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Provide Service support
  system                          | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Provide System support
  http                            | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Implementation of the OSGI HTTP Service
  http-whiteboard                 | 4.0.0.M2                         |          | x         | standard-4.0.0.M2                 | Provide HTTP Whiteboard pattern support
  war                             | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Turn Karaf as a full WebContainer
  jetty                           | 9.2.7.v20150116                  |          |           | standard-4.0.0.M2                 |
  kar                             | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Provide KAR (KARaf archive) support
  webconsole                      | 4.0.0.M2                         |          |           | standard-4.0.0.M2                 | Base support of the Karaf WebConsole
  ssh                             | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Provide a SSHd server on Karaf
  management                      | 4.0.0.M2                         | x        | x         | standard-4.0.0.M2                 | Provide a JMX MBeanServer and a set of MBeans in K
  scheduler                       | 4.0.0.M2                         |          |           | standard-4.0.0.M2                 | Provide a scheduler service in Karaf to fire event
  eventadmin                      | 4.0.0.M2                         |          |           | standard-4.0.0.M2                 | OSGi Event Admin service specification for event-b
  jasypt-encryption               | 4.0.0.M2                         |          |           | standard-4.0.0.M2                 | Advanced encryption support for Karaf security
  scr                             | 4.0.0.M2                         |          |           | standard-4.0.0.M2                 | Declarative Service support
  blueprint-web                   | 4.0.0.M2                         |          |           | standard-4.0.0.M2                 | Provides an OSGI-aware Servlet ContextListener for
  wrap                            | 0.0.0                            | x        | x         | standard-4.0.0.M2                 | Wrap URL handler
  profile                         | 4.0.0.M2                         |          |           | standard-4.0.0.M2                 | Profiles support
  jolokia                         | 1.2.4.SNAPSHOT                   |          |           | standard-4.0.0.M2                 | Jolokia monitoring support
  &lt;!-- lots of spring stuff --&gt;
  gemini-blueprint                | 1.0.2.RELEASE                    |          |           | spring-4.0.0.M2                   | Gemini Blueprint Extender
  pax-jdbc-spec                   | 0.5.0                            |          | x         | org.ops4j.pax.jdbc-0.5.0          | Provides OSGi JDBC Service spec
  pax-jdbc                        | 0.5.0                            |          |           | org.ops4j.pax.jdbc-0.5.0          | Provides JDBC Service support
  pax-jdbc-config                 | 0.5.0                            | x        | x         | org.ops4j.pax.jdbc-0.5.0          | Provides JDBC Config support
  pax-jdbc-derby                  | 0.5.0                            |          |           | org.ops4j.pax.jdbc-0.5.0          | Provides JDBC Derbi DataSourceFactory
  pax-jdbc-h2                     | 0.5.0                            |          |           | org.ops4j.pax.jdbc-0.5.0          | Provides JDBC H2 DataSourceFactory
  pax-jdbc-mariadb                | 0.5.0                            |          |           | org.ops4j.pax.jdbc-0.5.0          | Provides JDBC Mariadb DataSourceFactory
  pax-jdbc-mysql                  | 0.5.0                            | x        | x         | org.ops4j.pax.jdbc-0.5.0          | Provides JDBC MySQL DataSourceFactory
  pax-jdbc-oracle                 | 0.5.0                            |          |           | org.ops4j.pax.jdbc-0.5.0          | Provides JDBC Oracle DataSourceFactory
  pax-jdbc-postgresql             | 0.5.0                            |          |           | org.ops4j.pax.jdbc-0.5.0          | Provides JDBC PostgreSQL DataSourceFactory
  pax-jdbc-sqlite                 | 0.5.0                            |          |           | org.ops4j.pax.jdbc-0.5.0          | Provides JDBC SQLite DataSourceFactory
  pax-jdbc-pool-dbcp2             | 0.5.0                            | x        | x         | org.ops4j.pax.jdbc-0.5.0          | Provides JDBC Pooling DataSourceFactory
  pax-jdbc-pool-aries             | 0.5.0                            |          |           | org.ops4j.pax.jdbc-0.5.0          | Provides JDBC Pooling DataSourceFactory using Arie
  </code></pre>
  
  <p>On this last point, I've noticed what seems to be both jpa/2.0.0 and jpa/2.1.0 being loaded.  I've tried uninstalling the older version of jpa, but get the following:</p>
  
  <pre><code>karaf@root()&gt; feature:uninstall jpa/2.0.0
  Error executing command: Feature named 'jpa/2.0.0' is not installed
  </code></pre>