-->
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: I met a problem, and I can solve it. So can someone help me?
PostPosted: Sun Mar 05, 2006 12:37 am 
Beginner
Beginner

Joined: Sun Mar 05, 2006 12:16 am
Posts: 31

I'm a Chinese senior student, so my English is poor.
Plese forgive me for my English problems.
I'm just a newbie to Hibernate, please help me.
ForumHome is the DAO generated by Hibernate Tools
the findById method is just as below.
...
Forum instance = (Forum) sessionFactory.getCurrentSession().get("net.xarock.kdc.forum.entity.Forum", id);
...


Hibernate version:
3.1.2

Hibernate settings:
...
<property name="hibernate.current_session_context_class">
jta
</property>
<property name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.show_sql">
True
</property>
<property name="hibernate.use_outer_join">
True
</property>
<property name="hibernate.transaction.manager_lookup_class">
JBossTransactionManagerLookup
</property>
<property name="hibernate.transaction.factory_class">
JTATransactionFactory
</property>
<property name="jta.UserTransaction">
UserTransaction
</property>
...

Codes:
Code:
//To register SessionFactory to JNDI
Configuration c=new Configuration().configure();
org.hibernate.SessionFactory sf=c.buildSessionFactory();
org.hibernate.Session s=sf.openSession();
Forum f1=null;
//The codes below is the actual codes
UserTransaction ut=(UserTransaction)new InitialContext().lookup("UserTransaction");
ut.begin();
f1=new ForumHome().findById(new Integer(1));
ut.commit();


Error:
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: TransactionFactory class not found: JTATransactionFactory
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)


root cause

org.hibernate.HibernateException: TransactionFactory class not found: JTATransactionFactory
org.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(TransactionFactoryFactory.java:41)
org.hibernate.cfg.SettingsFactory.createTransactionFactory(SettingsFactory.java:370)
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:120)
org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
org.apache.jsp.test1_jsp._jspService(org.apache.jsp.test1_jsp:59)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 06, 2006 4:00 am 
Regular
Regular

Joined: Tue Dec 14, 2004 5:21 am
Posts: 104
Location: india
check out your hibernate.cfg.xml file and
make sure you have specified fully qualified name of transaction factory class . for hibertnate 3 it is org.hibernate.transaction.JTATransactionFactory.

_________________
sHeRiN
thanks for your ratings ...... :)


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.