jupson_us wrote:
Without all the details, my suspicion (only because I just encountered a similar problem with Websphere) is that you have a CMT in which you are trying to use Hibernate Transaction API?
I think there is some differences in the interpretation of the specification, but, the latest release of both Oracle and IBM's Application Servers appear to not allow you to access the usertransation from within a CMT. Hibernate expects the UserTransaction to be available, hence the error in your stack trace.
Websphere provides an extendedJTATransaction API that allows you to tie back to the UserTransaction in a propietary fashion. Perhaps OC4J has something similar.
I am trying to do the same thing using hibernate 3.0.5 without success, when I try to do some transactional stuff, the folowing exception is thrown:
org.hibernate.HibernateException: Could not locate TransactionManager
at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:26)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:270)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
at br.com.portage.banco.frw.dao.hibernate.AbstractHibernateDAO.<clinit>(AbstractHibernateDAO.java:31)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at br.com.portage.banco.frw.dao.DAOFactory.getDAO(DAOFactory.java:69)
at br.com.portage.banco.ejb.ContaBean.novaConta(ContaBean.java:38)
at Conta_StatelessSessionBeanWrapper0.novaConta(Conta_StatelessSessionBeanWrapper0.java:100)
at br.com.portage.banco.web.NovaContaServlet.doPost(NovaContaServlet.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:534)
Caused by: javax.naming.NameNotFoundException: Only session and message-driven beans with bean-managed transaction are allowed to use UserTransaction
at com.evermind.server.ApplicationContext.lookupJavaCompRsrc(ApplicationContext.java:180)
How can I use Hibernate + OC4J + CMT?
Thanks