From your mail I would say you want to use hibernate not openjpa. So
what you need is not the openjpa but the jpa feature.
You should also not use the individual hibernate bundles but rather use
their feature.
Use this URI for the hibernate feature repo:
mvn:org.hibernate/hibernate-osgi/5.1.0.Final/xml/karaf
And this for CXF:
mvn:org.apache.cxf.karaf/apache-cxf/3.1.5/xml/features
For hibernate 5 you can use the newest versions of the jpa and
transaction features.
See also this feature as a reference (even if it does not use hibernate 5:
https://github.com/cschneider/Karaf-Tutorial/blob/master/tasklist-blueprint-cdi/features/src/main/resources/features.xml
Christian
On 09.03.2016 16:17, Olivier21 wrote:
Hello,
I created a datasource in Karaf 4.0.4.
For that, I installed the features :
feature:install pax-jdbc
feature:install pax-jdbc-config
feature:install pax-jdbc-pool-dbcp2
feature:install jdbc
Everything works fine and I have a good result when I execute the command
"jdbc:tables database_name".
I try to do a RestFul Web Service therefore I installed cxf 3.1.4
Now, I try to run a project using *JPA 2* and *hibernate*.
I have a file called feature.xml which allow to create a KAR file. In this
XML file, I wrote these lines :
<bundle>mvn:org.osgi/org.osgi.core/6.0.0</bundle>
<bundle>mvn:org.apache.cxf/cxf-rt-frontend-jaxrs/3.1.4</bundle>
<bundle>mvn:org.apache.cxf/cxf-rt-frontend-jaxws/3.1.4</bundle>
<bundle>mvn:org.apache.cxf/cxf-rt-transports-http-jetty/3.1.4</bundle>
<bundle>mvn:org.hibernate/hibernate-core/5.0.5.Final</bundle>
<bundle>mvn:org.hibernate/hibernate-osgi/5.0.5.Final</bundle>
<bundle>mvn:org.hibernate/hibernate-entitymanager/5.0.5.Final</bundle>
<bundle>mvn:org.jboss/jandex/2.0.0.Final</bundle>
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5</bundle>
<bundle>mvn:org.javassist/javassist/3.20.0-GA</bundle>
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5</bundle>
<bundle>mvn:org.hibernate.common/hibernate-commons-annotations/5.0.1.Final</bundle>
<bundle>mvn:org.jboss.logging/jboss-logging/3.3.0.Final</bundle>
<bundle>mvn:org.eclipse.persistence/javax.persistence/2.1.1</bundle>
But I don't know what are the release of the features "OpenJPA",
"transaction" and "transaction-api" to use.
For your information, in my blueprint.xml file, I put this :
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:jpa="http://aries.apache.org/xmlns/jpa/v2.0.0"
xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.2.0">
In fact, when I try to run my project, I have this error :
*Bundle data/0.0.1.SNAPSHOT is waiting for namespace handlers
[http://aries.apache.org/xmlns/jpa/v2.0.0,
http://aries.apache.org/xmlns/transactions/v1.2.0]*
And the state of my bundle is "GracePeriod".
Please, could you help me to complete the file feature.xml?
Thank you in advance.
--
View this message in context:
http://karaf.922171.n3.nabble.com/JPA-and-Hibernate-tp4045735.html
Sent from the Karaf - User mailing list archive at Nabble.com.
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
http://www.talend.com