Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.1
Hibernate Annotations version: 3.1 beta8
Mapping documents: Annotations
Full stack trace of any exception that occurs:
Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/hiber
nate/cfg/SecondPass
Exception in thread "main" java.lang.ExceptionInInitializerError
at hsbc.hibernatestart.HibernateUtil.<clinit>(HibernateUtil.java:20)
at hsbc.hibernatestart.EventManager.store(EventManager.java:50)
at hsbc.hibernatestart.EventManager.main(EventManager.java:20)
Caused by: java.lang.NoClassDefFoundError: org/hibernate/cfg/SecondPass
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(Anno
tationConfiguration.java:270)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(Annotatio
nConfiguration.java:210)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1036)
at hsbc.hibernatestart.HibernateUtil.<clinit>(HibernateUtil.java:15)
... 2 more
I had seen the hibernate-annotations.jar(3.1 beta8) after unzipping it, which has a reference to
org/hibernate/cfg/SecondPass but this class is not present in the jar.
I searched SecondPass.class & found it in hibernate-annotations.jar(3.1 beta4) but adding this file is again giving the error.
Name and version of the database you are using: hsqldb 1.8.0
Here is the code for creation of Session Factory
sessionFactory = new AnnotationConfiguration().addAnnotatedClass(Event.class).buildSessionFactory();