Error when trying to use hibernate annotations.
- by Wilhelm
The error I'm receiving is listed here.
That's my HibernateUtil.java
package com.rosejapan;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;;
public class HibernateUtil
{
private static final SessionFactory sessionFactory;
static
{
try
{
// Create the SessionFactory from hibernate.cfg.xml
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
} catch(Throwable e)
{
System.err.println("Initial sessionFactory creation failed. " + e);
throw new ExceptionInInitializerError(e);
}
}
public static SessionFactory getSessionFactory()
{
return sessionFactory;
}
}
Everything looks all right... I've already included log4j-boot.jar in the CLASSPATH, but didn't resolved my problem.