1

I am new to Karaf and have been tasked to implement JPA using Hibernate in a Karaf container. I thought a good place to start would be sample demo code for container managed persistence at JBoss. I have built the jar file in this demo/example (managed-jpa-1.0.0.jar), downloaded Karaf 4.1.0, and attempted to follow the few steps to run the sample that interacts with an H2 datastore.

According to the README provided with the sample I need to execute the following in the Karaf console: (Version was set to "5.0.0.Final")

  • feature:repo-add mvn:org.hibernate/hibernate-osgi/[VERSION]/xml/karaf
  • feature:install hibernate-orm
  • feature:repo-add file:/hibernate-demos-master/hibernate-orm/osgi/managed-jpa/features.xml
  • feature:install hibernate-osgi-managed-jpa

The features.xml file with the demo shows a dependency on the H2 database bundle and a blueprint file. It requires features "transaction", "jpa", and "jndi".

Looks like the first three commands execute without issue, but the last,"feature:install hibernate-osgi-managed-jpa" displays an error in the console
Error executing command: Unable to resolve root: missing requirement[root]...

bundle:diag managed-jpa shows the following: Missing dependencies: (&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=\http://aries.apache.org/xmlns/jpa/v1.0.0)) (&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=\http://aries.apache.org/xmlns/transactions/v1.0.0))

JPA and Transaction must not be installed?

I tried to resolve

  • feature:install transaction
  • feature:repo-add mvn:org.apache.aries.jpa/jpa-features/2.5.0/xml/features
  • feature:install jpa

still an issue with dependencies: Missing dependencies: (&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=\http://aries.apache.org/xmlns/jpa/v1.0.0))

Not sure what I am missing at this point.

1 Answers1

0

Try changing your namespace in blueprint.xml from "http://aries.apache.org/xmlns/jpa/v1.0.0" to "http://aries.apache.org/xmlns/jpa/v2.0.0"