Joined: Wed Feb 22, 2006 11:56 pm Posts: 3
|
I am getting this error while trying to instantiate a Hibernate session:
-----------
java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPass
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1779)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:866)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1319)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
org.hibernate.cfg.Configuration.add(Configuration.java:385)
org.hibernate.cfg.Configuration.addInputStream(Configuration.java:426)
org.hibernate.cfg.Configuration.addClass(Configuration.java:502)
----------
I checked hibernate.jar and there is no such class.
The code used to get session:
public DatabaseSession() {
try {
Configuration cfg = new Configuration();
cfg.addClass(com.Test.class);
sessionFactory = cfg.buildSessionFactory();
} catch (Exception ex) {
// Log exception!
log.error("trying to create db session factor", ex);
throw new ExceptionInInitializerError(ex);
}
}
|
|