-->
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: regrading hibernate error
PostPosted: Thu Aug 24, 2006 2:22 am 
Newbie

Joined: Wed Aug 16, 2006 6:48 am
Posts: 2
Location: hyderabad
hi friends,
i am new to hibernate, and i am doing a standalone application using hibernate.

i use myclipse 5.x version, from that i reverse engineered a database table name STUDENT with fields, NAME, AGE.
i got project structure like this,

AbstractStudent.java, --> this is abstract class consists of getter and setter methods
AbstractStudentId.java,
HibernateSessionFactory.java----> this is the SessionFactory class
Student.java --> this is the table mapping class extends AbstractStudent.java
StudentId.java, and
Student.hbm.xml file (xml mapping file)
hibernate.cfg.xml file.

i wrote hibernate.properties file, and log4j.properties file,

and client file which uses hibernate is like this:----
public class StudentIfo {
public static void main(String[] args) {
StudentIfo sinfo = new StudentIfo();
Session session = HibernateSessionFactory.getSession();
session.beginTransaction();
Configuration cfg = new Configuration();
Student student = new Student();
//System.out.println("this is the class "+student.getClass());
}
}

and when i run this project, i am getting an like this:-

2047 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: net.sf.hibernate.transaction.JTATransactionFactory
2047 [main] ERROR org.hibernate.transaction.TransactionFactoryFactory - TransactionFactory class not found
java.lang.ClassNotFoundException: net.sf.hibernate.transaction.JTATransactionFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(TransactionFactoryFactory.java:37)
at org.hibernate.cfg.SettingsFactory.createTransactionFactory(SettingsFactory.java:366)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:120)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
at com.org.hibernate.student.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:60)
at com.org.hibernate.student.HibernateSessionFactory.getSession(HibernateSessionFactory.java:43)
at com.org.studentinfo.StudentIfo.main(StudentIfo.java:37)
%%%% Error Creating SessionFactory %%%%
org.hibernate.HibernateException: TransactionFactory class not found: net.sf.hibernate.transaction.JTATransactionFactory
at org.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(TransactionFactoryFactory.java:41)
at org.hibernate.cfg.SettingsFactory.createTransactionFactory(SettingsFactory.java:366)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:120)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
at com.org.hibernate.student.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:60)
at com.org.hibernate.student.HibernateSessionFactory.getSession(HibernateSessionFactory.java:43)
at com.org.studentinfo.StudentIfo.main(StudentIfo.java:37)
Exception in thread "main" java.lang.NullPointerException
at com.org.studentinfo.StudentIfo.main(StudentIfo.java:38)

please can any body explain about what is the wrong i am doing.
it is very urgent for me. if possible mail to my id
vemulakirankumar@gmail.com


regards,
kirankumar vemula

_________________
vemulakirankumar,
geospaceintegra,
secunderabad.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 24, 2006 2:28 am 
Newbie

Joined: Thu Jun 01, 2006 8:51 am
Posts: 6
You exception tells you very clearly that TransactionFactory class not found java.lang.ClassNotFoundException: net.sf.hibernate.transaction.JTATransactionFactory

You are using a new version of hibernate but you are referencing the old package. ie., net.sf.hibernate.transaction.JTATransactionFactory

use org.hibernate.transaction.JTATransactionFactory

Thanks
Prashanth


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.