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.  [ 1 post ] 
Author Message
 Post subject: Could not find UserTransaction in JNDI
PostPosted: Mon Aug 21, 2006 9:46 am 
Newbie

Joined: Mon Aug 21, 2006 9:34 am
Posts: 6
I'm having problems configuring hibernate to work with JNDI. I suppose my .cfg file is correct, because i've been reading the documentations. Maybe there's something missing, or something i didn't understand. Anyway, the problem is about transactions.

The exception:
Code:
org.hibernate.TransactionException: Could not find UserTransaction in JNDI:
   org.hibernate.transaction.JTATransaction.<init>(JTATransaction.java:64)
   org.hibernate.transaction.JTATransactionFactory.createTransaction(JTATransactionFactory.java:53)
   org.hibernate.jdbc.JDBCContext.getTransaction(JDBCContext.java:177)
   org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:1279)
   org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1289)
   br.com.ReportWizardAdmin.action.categoria.IncluirCategoriaAction.execute(IncluirCategoriaAction.java:95)
   org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
   org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
   org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
   org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)


In line, where Session s is properly initialized:
Code:
Transaction tx = s.beginTransaction();


My .cfg file:

Code:
<hibernate-configuration>
    <session-factory name="java:comp/env/hibernate/SessionFactory">
      
        <property name="hibernate.connection.datasource">java:/comp/env/jdbc/ReportWizardAdmin</property>
        <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
       
        <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
        <property name="jta.UserTransaction">java:comp/UserTransaction</property>
<!-- Mapping files not listed here -->
   </session-factory>
</hibernate-configuration>


Using Hibernate 3 and Oracle 8.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.