Hello,

I am trying to get JPA & Hibernate working in a OSGI bundle, deployed on
Karaf 4.0.8. 
Regardless of what tutorials or guides I follow, I am met with the following
log entry:

org.desolateplanet.authentication-db-impl/0.0.9.SNAPSHOT is waiting for
namespace handlers [http://aries.apache.org/xmlns/jpa/v1.0.0]

The entity manager is never injected via blueprint as the breakpoint I set
is never hit. 

I'd had more success with direct JDBC, but I don't want to resort to that
just yet in case I'm missing something silly. I've attached the
blueprint/pom/persistence.xml below for reference.

== POM dependencies ==
 <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>authentication-api</artifactId>              
        </dependency> 
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi</artifactId>
        </dependency> 
        
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.util.tracker</artifactId>
        </dependency>        
        
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
        </dependency>
            
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.cm</artifactId>
        </dependency>
                 
        <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>javax.transaction-api</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.3.174</version>
        </dependency>
        
       
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.enterprise</artifactId>
            <version>4.2.0</version>
        </dependency>
       

        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
            <version>1.0.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.6.Final</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-osgi</artifactId>
            <version>4.3.6.Final</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.3.6.Final</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate.common</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>4.0.4.Final</version>
        </dependency>
    </dependencies>

== Persistence.xml ==
<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";>
  <persistence-unit name="authentication" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>osgi:service/authentication</jta-data-source>
    <properties>
      <property name="hibernate.dialect"
value="org.hibernate.dialect.H2Dialect"/>
    </properties>
  </persistence-unit>
</persistence>

== blueprint.xml ==
<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";>
           
    

    <bean id="accountStore"
class="org.desolateplanet.security.impl.AccountStoreImpl">     
        <jpa:context unitname="authentication" property="entityManager"/>
        <tx:transaction method="*" value="Required"/>
    </bean>
  

</blueprint>







--
View this message in context: 
http://karaf.922171.n3.nabble.com/Hibernate-JPA-and-Karaf-4-tp4050569.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to