-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problems with Transactions and JBoss
PostPosted: Tue Sep 16, 2003 12:17 pm 
Newbie

Joined: Mon Sep 08, 2003 12:45 pm
Posts: 10
Hi!

I'm using JBoss 3.0.3 with Hibernate 2.1beta3 and Struts 1.1

The code tx = session.beginTransaction(); raises the following error:

2003-09-16 18:08:28,437 ERROR [org.jboss.web.localhost.Engine] StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
javax.servlet.ServletException: Could not find UserTransaction in JNDI: : UserTransaction not bound

My jboss-service.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<server>
<mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory,name=HibernateFactory">
<depends>jboss.jca:service=RARDeployer</depends>
<depends>jboss.jca:service=LocalTxCM,name=MySqlTestDS</depends>
<!-- Make it deploy ONLY after DataSource had been started -->
<attribute name="MapResources">WEB-INF/classes/de/sam/strutstest/dto/mappings/User.hbm.xml</attribute>
<attribute name="JndiName">java:/hibernate/HibernateFactory</attribute>
<attribute name="Datasource">java:/MySqlTestDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.MySQLDialect</attribute>
<attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
<attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
<attribute name="UseOuterJoin">false</attribute>
<attribute name="ShowSql">false</attribute>
<attribute name="UserTransactionName">java:/UserTransaction</attribute>
</mbean>
</server>

I can see that UserTransaction is defined, but I don't know where it is added to JNDI.

Is there a documentation of all parameters for file jboss-service.xml?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2003 5:35 pm 
Beginner
Beginner

Joined: Thu Sep 25, 2003 5:22 pm
Posts: 29
Location: NC
Hey, I had this problem. I am using jboss3.2.1-tomcat4.1.24 and deployed my hibernate app into /server/default/deploy. What I did:

1.) Go into /server/conf/jboss-service.xml and change a line from
<attribute name="UserTransactionService">jboss:service=ClientUserTransaction</attribute>

to

<attribute name="UserTransactionService">jboss:service=UserTransaction</attribute>

2.) In /server/default/deploy/transaction-service.xml, change
<mbean code="org.jboss.tm.usertx.server.ClientUserTransactionService"
name="jboss:service=ClientUserTransaction">
</mbean>

to

<mbean code="org.jboss.tm.usertx.server.ClientUserTransactionService"
name="jboss:service=UserTransaction">
</mbean>

This resolved that issue for me. However, I am not running any other apps other than my Hibernate testing, so I am not entirely sure what this would do to anything else you have running. Someone else might have a less intrusive fix.

-Kat


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.