Thanks for your quick response but after replacing what you told me, the error is still there. Here is my code :
Code:
static {
try {
// Create the SessionFactory
[color=red] sessionFactory = new Configuration().configure().buildSessionFactory();[/color] }
catch (Throwable ex) {
ex.printStackTrace();
throw new ExceptionInInitializerError(ex);
}
}
When debbuging, the call to the line in red works fine and do not throw any exception, it is the call to sessionFactory.openSession() that throws "something" that I cannot catch in my call :
Code:
try {
Session session = HibernateUtil.currentSession();
Transaction tx = session.beginTransaction();
Cat princess = new Cat();
princess.setName("Princess");
princess.setSex('F');
princess.setWeight(7.4f);
session.save(princess);
tx.commit();
}
catch (Exception he) {
System.out.println("Hello");
he.printStackTrace();
}