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