You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Umar Zubair <ub...@mobileweaver.dk> on 2007/07/27 15:31:29 UTC

How to support JTA Transaction in tomcat to use JBoss Tree cache

I am using hibernate. I am looking to use JTA Transaction because i want to
use JBoss tree cache for cluster environment. My hibernate.cfg.xml files
contains

 

<session-factory>

      <property name="connection.datasource">java:comp/env/MykDS</property>

      <!-- SQL dialect -->

      <property name="dialect">org.hibernate.dialect.MySQLDialect</property>

      <property
name="transaction.factory_class">org.hibernate.transaction.JTATransactionFac
tory</property>

      <property
name="jta.UserTransaction">java:comp/UserTransaction</property>

      <property
name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTrans
actionManagerLookup</property>

 </session-factory>   

 

MyDS is defined in config/server.xml by

 

<Context path="/Administration" docBase="Administration"

                                                            debug="5"
reloadable="true" crossContext="true">

                                    

                                      <Resource name="MyDS" auth="Container"
type="javax.sql.DataSource"

               maxActive="100" maxIdle="30" maxWait="10000"

                                                username="root"
password="root" driverClassName="com.mysql.jdbc.Driver"

 
url="jdbc:mysql://localhost:3306/mydb"

                                       removeAbandoned="true"

                                       removeAbandonedTimeout="600"

                                       logAbandoned="true"/>

 

</Context>

 

When I start to tomcat, I am facing following exception.

How can we use JTATransactions in tomcat.

 

141640 [http-8080-Processor25] ERROR
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].

/Administration].[Faces Servlet]  - Servlet.service() for servlet Faces
Servlet threw exception%jav

x.naming.NameNotFoundException: Name TransactionManager is not bound in this
Context

        at org.apache.naming.NamingContext.lookup(NamingContext.java:769)

        at org.apache.naming.NamingContext.lookup(NamingContext.java:152)

        at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)

        at javax.naming.InitialContext.lookup(InitialContext.java:351)

        at
org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager
(JNDITransac

ionManagerLookup.java:23)

        at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:325)

        at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)

        at
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConf
iguration.ja

a:915)

        at
com.mw.framework.util.HibernateUtil.<clinit>(HibernateUtil.java:37)

 

 

Thanks in advance

Umar