I think this can be caused by persistence api 2.0 and 2.1 being
installed at the same time.
Normally karaf should make sure only one is installed but in some
circumstances this can happen.
In this case hibernate will publish the PersistenceProvider with the 2.0
package version while Aries JPA will look for a service on the 2.1
package. So it will not find it.
Aries JPA 2.1.0 has the issue that it injects a proxy to the
EntityManagerFactory regardless if it is there. The new Aries JPA 2.2.0
version should correctly handle this so the bundle is only started
when the EntityManagerFactory is actually there. Unfortunately I just
found an issue with the new version.
https://issues.apache.org/jira/browse/ARIES-1430
Christian
On 11.10.2015 21:17, conejo wrote:
Hi Christian:
karaf@root()> service:list EntityManagerFactory
[javax.persistence.EntityManagerFactory]
----------------------------------------
osgi.unit.name = salazarJPA
osgi.unit.provider = org.hibernate.jpa.HibernatePersistenceProvider
osgi.unit.version = 0.0.1
service.bundleid = 168
service.id = 206
service.scope = singleton
Provided by :
DataBaseService (168)
For some reason if I change to Hibernate 4.2.15 the EntityManagerFactory not
registry.
On the other hand, I know the EntityManger not injected because an exception
occurs when using it (it is null).
--
View this message in context:
http://karaf.922171.n3.nabble.com/Migration-to-Karaf-4-0-1-tp4042982p4043016.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