|
Hibernate 4.2.7.SP1 was the first version that ran with transactions on the OSGi container JBoss Fuse 6 (thanks to
HHH-8633
). The current release candidate 4.3.0.CR1 does not.
There's been some changes to hibernate-osgi between 4.2.7.SP1 and 4.3.0.CR1, and Hibernate is no longer able to lookup the javax.transaction.TransactionManager from the service registry. The log claims that the TransactionManager is available, and we've verified that this is true with the debugger (by stopping all threads at the point Hibernate does the lookup and verify that a TransactionManager is available from the bundleContext). Hibernate fails with the exception
Caused by: org.hibernate.TransactionException: Cannot retrieve the TransactionManager OSGi service!
at org.hibernate.osgi.OsgiJtaPlatform.retrieveTransactionManager(OsgiJtaPlatform.java:66)
at org.hibernate.osgi.OsgiJtaPlatform.getCurrentStatus(OsgiJtaPlatform.java:113)
at org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory.isJoinableJtaTransaction(CMTTransactionFactory.java:65)
Hibernate 4.3.0 use the ServiceTracker API from OSGi 4.3 which should be supported by the version of Apache Felix shipping with JBoss Fuse.
The test case attached explains how to set up an instance of JBoss Fuse 6 with hibernate and a sample application. The sample application was attached the RedHat support cased that spawned
HHH-8633
. It's therefore closer to a production environment than what's strictly necessary to illustrate this error.
|