Using JBoss 4.0.2 (bundled Hibernate 3.0.2 i think.) with an EAR (war and har).
Everything works fine the first time the app is deployed but if I try to re-deploy the app or undeploy then deploy I get and exception from Hibernate. If I restart the app server everything works fine.
Code:
org.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
I am using a HAR and getting the session with .getCurrentSession().
I am also getting a transaction before using
Code:
Context ctx = new InitialContext();
UserTransaction utx = utx = (UserTransaction) ctx.lookup("java:/comp/UserTransaction");
if(utx.getStatus() == Status.STATUS_NO_TRANSACTION) {
utx.begin();
}
Anyone have any idea what is happening?
Code:
**** hibernate-service.xml ****
<mbean code="org.jboss.cache.TreeCache" name="jboss.har:service=HarSecondLevelCache">
<!--attribute name="CacheLoaderClass">org.jboss.cache.loader.bdbje.BdbjeCacheLoader</attribute-->
<attribute name="CacheLoaderClass">org.jboss.cache.loader.FileCacheLoader</attribute>
<attribute name="CacheLoaderConfig">
location=c:\\tmp\\bdbje
</attribute>
<attribute name="CacheLoaderShared">true</attribute>
<attribute name="CacheLoaderPreload">/</attribute>
<attribute name="CacheLoaderFetchTransientState">false</attribute>
<attribute name="CacheLoaderFetchPersistentState">true</attribute>
</mbean>
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">
<depends>jboss:service=Naming</depends>
<depends>jboss:service=TransactionManager</depends>
<depends>jboss.har:service=HarSecondLevelCache</depends>
<attribute name="DatasourceName">java:/story7dev2</attribute>
<attribute name="Dialect">org.hibernate.dialect.Oracle9Dialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
<!-- our other mbean attributes -->
<attribute name="CacheProviderClass">org.jboss.hibernate.cache.DeployedTreeCacheProvider</attribute>
<attribute name="DeployedTreeCacheObjectName">jboss.har:service=HarSecondLevelCache</attribute>
<attribute name="ShowSqlEnabled">true</attribute>
</mbean>