[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - How to support JTA Transaction in tomcat for JBoss cache
umarzubair1
do-not-reply at jboss.com
Fri Jul 27 09:26:53 EDT 2007
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>
java:comp/env/MykDS
<!-- SQL dialect -->
org.hibernate.dialect.MySQLDialect
org.hibernate.transaction.JTATransactionFactory
java:comp/UserTransaction
org.hibernate.transaction.JBossTransactionManagerLookup
</session-factory>
MyDS is defined in config/server.xml by
< 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"/>
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.(SessionFactoryImpl.java:325)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.ja
a:915)
at com.mw.framework.util.HibernateUtil.(HibernateUtil.java:37)
Thanks in advance
Umar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068206#4068206
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068206
More information about the jboss-user
mailing list