Question

I am using Karaf 3.0.0, Hibernate 4.2.7.Final, container-managed jpa.

The persistence bundle moves to GracePeriod state on starting and then goes to Failure. Below is the error from Karaf logs when starting the bundle.

2014-04-07 16:46:01,716 | INFO | Local user karaf | BlueprintContainerImpl | 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle ecomm.dao.impl.hibernate is waiting for dependencies [(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=ecomm))(objectClass=javax.persistence.EntityManagerFactory)), (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=ecomm))(objectClass=javax.persistence.EntityManagerFactory))]

I have installed jpa, transaction and jndi features before installing hibernate. I havent installed the openjpa feature.

Also, Aries JPA Container Managed Contexts and Aries JPA Container bundles are both active. Also noticed that there is no EntityManagerFactory service as suggested at Jpa-hibernate error while starting the service

Below is a snapshot of the hibernate bundles.

karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
 ID | State       | Lvl | Version            | Name
------------------------------------------------------------------------------------
115 | Active      |  80 | 3.0.0              | Apache Karaf :: JNDI :: Command
121 | Active      |  80 | 0.9.0              | ClassMate
122 | Active      |  80 | 2.7.7.5            | Apache ServiceMix :: Bundles :: antlr
123 | Active      |  80 | 1.8.2.2            | Apache ServiceMix :: Bundles :: ant
124 | Active      |  80 | 1.6.1.5            | Apache ServiceMix :: Bundles :: dom4j
125 | Active      |  80 | 1.14.1.1           | Apache ServiceMix :: Bundles :: serp
126 | Active      |  80 | 3.18.1.GA          | Javassist
127 | Active      |  80 | 1.0.2.Final        | JACC 1.4 API
128 | Active      |  80 | 0                  | wrap_mvn_org.jboss_jandex_1.1.0.Final
129 | Active      |  80 | 3.1.3.GA           | JBoss Logging 3
130 | Active      |  80 | 4.0.4.Final        | hibernate-commons-annotations
135 | Active      |  80 | 4.2.7.Final        | hibernate-core
136 | Active      |  80 | 4.2.7.Final        | hibernate-entitymanager
137 | Active      |  80 | 4.2.7.Final        | hibernate-osgi
138 | Active      |  80 | 1.1.0.201404041646 | Ecomm Store
139 | Active      |  80 | 1.1.0.201404041646 | Ecomm Dao
140 | GracePeriod |  80 | 1.4.0.201404071644 | Ecomm DAO Impl

Is there something that is missing in my configuration?

Thank you.

Was it helpful?

Solution 2

The issue is reolved now after changing the order in which the bundles were started. The persistence unit bundle ("Ecomm DAO Impl" in my case) must be started before the hibernate-osgi bundle is started.

OTHER TIPS

I pointed to a possible solution for your other question which should also apply here. See Jpa-hibernate error while starting the service

In any case be sure to stay away from Hibernate 4.3.x for now as it is not supported by aries jpa till now. 4.2.7 should work though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top