java.lang.NoClassDefFoundError: Could not initialize class org.com.hibernate.HibernateUtil

后端 未结 4 1342
一向
一向 2021-01-24 08:18

This is my hibernate util code

public class HibernateUtil {

private static final SessionFactory sessionFactory = buildSessionFactory();

private static SessionF         


        
4条回答
  •  一生所求
    2021-01-24 08:34

    You can download jars related to hibernate at

    http://sourceforge.net/projects/hibernate/files/hibernate3

    unzip it and check whether the following files are added to your lib folder

    Anttr-2.7.6.jar
    asm.jar
    asm-attrs.jar
    cglib-2.1.3.jar
    commons-collections-2.1.1.jar
    commons-logging-1.0.4.jar
    ehcash.jar
    dom4j-1.6.1.jar
    hibernate3.jar    <--Check this version of your jar
    jta.jar
    log4j-1.2.3.jar
    

    To run hibernate related programming and among all the jars hibernate3.jar is the main file..

    Along with the hibernate jars you must include one more jar file related to the type of database(mysql,oracle,etc..) you use..

    Try using proper versions of jar before you execute your program...some versions of jars are not supported to run...and the latest one is recommended...

提交回复
热议问题