i have read about the add of dom4 jar in classpath and i already did it but really dont do anything...so i guess something is wrong with my configuration cause the session doesnt seem to initialize...
Version of hibernate 3.2
This is the code between SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); and sessionn.save(testing);
------------------------------
sessionn = sessionFactory.openSession();
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
//Create new instance of Contact and set values in it by reading them from form object
System.out.println("Inserting Record");
This is the Full result :
Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/dom4j/DocumentException
Exception in thread "main" java.lang.NullPointerException
at Test.main(Test.java:69)
Name and version of the database you are using: MYsql 5.0
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="hibernate.connection.password">t3st</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/test</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
</session-factory>
</hibernate-configuration>