-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: JBoss 4.0.2 w/HAR and JTA TransactionManager Error
PostPosted: Thu Jul 28, 2005 10:20 am 
Newbie

Joined: Fri Jul 15, 2005 10:02 am
Posts: 12
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>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 12:28 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Nope, no idea. I have a test in the jboss test suite that explicitly tests redeployment of hars.

Whats the stack trace you get?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 4:26 pm 
Newbie

Joined: Fri Jul 15, 2005 10:02 am
Posts: 12
Ok so I took a look at my DAO layer and there were some Transactions and commits that were left in there before I switched to a JNDI bound SessionFactory. I removed those and now it re-deploys with no problem.

I need some coffee or a swift kick to the head.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.