-->
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: JOTM and hibernate
PostPosted: Thu Dec 02, 2004 7:32 am 
Newbie

Joined: Thu Dec 02, 2004 7:23 am
Posts: 2
I am having problems with JOTM and Hibernate. I am getting a ClassCastException when opening a new session. My hibernate.cfg.xml contains this;

<property name="hibernate.transaction.factory_class">
net.sf.hibernate.transaction.JTATransactionFactory
</property>
<property name="hibernate.transaction.manager_lookup_class">
net.sf.hibernate.transaction.JOTMTransactionManagerLookup
</property>
<property name="jta.UserTransaction">
java:comp/UserTransaction
</property>

I can successfully use the JDBCTransactionFactory without JOTM. I have also successfully used JOTM without Hibernate with the same context.xml (this is running inside tomcat).

When I do an openSession(), I get the exception below, caused by a ClassCastException.

Any help would be greatefully appreciated!

Hibernate version: 2.1.7c

Full stack trace of any exception that occurs:
net.sf.hibernate.HibernateException: Could not obtain JOTM transaction manager instance
at net.sf.hibernate.transaction.JOTMTransactionManagerLookup.getTransactionManager(JOTMTransactionManagerLookup.java:24)
at net.sf.hibernate.transaction.JTATransactionFactory.configure(JTATransactionFactory.java:48)
at net.sf.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(TransactionFactoryFactory.java:48)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:77)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1160)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:794)
at net.sf.cendil.test.SessionFactoryHolder.getSessionFactory(SessionFactoryHolder.java:19)
at net.sf.cendil.test.html.HomePage.pageBeginRender(HomePage.java:92)
at org.apache.tapestry.AbstractPage.firePageBeginRender(AbstractPage.java:463)
at org.apache.tapestry.AbstractPage.beginPageRender(AbstractPage.java:514)
at org.apache.tapestry.engine.RequestCycle.rewindForm(RequestCycle.java:433)
at org.apache.tapestry.form.Form.trigger(Form.java:582)
at org.apache.tapestry.engine.DirectService.service(DirectService.java:169)
at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:872)
at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197)
at org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:326)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.hivemind.servlet.HiveMindFilter.doFilter(HiveMindFilter.java:136)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:731)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassCastException: org.objectweb.jotm.Current
at net.sf.hibernate.transaction.JOTMTransactionManagerLookup.getTransactionManager(JOTMTransactionManagerLookup.java:21)
... 34 more

Name and version of the database you are using: MySQL 4.1.7


Top
 Profile  
 
 Post subject: Answered...
PostPosted: Fri Dec 03, 2004 4:36 am 
Newbie

Joined: Thu Dec 02, 2004 7:23 am
Posts: 2
I had a copy of jta.jar on my classpath, when I should have just had a copy of jta-spec1_0_1.jar that is packaged with JOTM.

JOTM is a very useful addition to Tomcat.


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.