Hi all,
Even tough I have experience with openJPA... I'm new to hibernate and I'm trying to run a few online tutorials in order to get an understanding of how it handles things and get an overview performance wise....
My issue is that any single tutorial I run, even though I'm strictly following the instructions ends with the same error.... The error manifest through line "SessionFactory factory = new AnnotationConfiguration().configure().buildSessionFactory();" and gives the follwing output... I just don't undestand why this is happening in every single tutorial I have used.... I have the hibernate.cfg.xml in the root directory and added all mentioned jars in the classpath; I have used tutorials with both MySQL and HSQL dbases and both with annotations and configurations files, the result is always the same.....
Any suggestions will be more than welcome....
Many thanks in advance.....
Mike
0 [main] INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.5.6-Final 0 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.5.6-Final Exception in thread "main" java.lang.ExceptionInInitializerError at org.hibernate.cfg.Configuration.reset(Configuration.java:249) at org.hibernate.cfg.AnnotationConfiguration.reset(AnnotationConfiguration.java:289) at org.hibernate.cfg.Configuration.<init>(Configuration.java:216) at org.hibernate.cfg.Configuration.<init>(Configuration.java:220) at org.hibernate.cfg.AnnotationConfiguration.<init>(AnnotationConfiguration.java:168) at sample.PopulateMessages.main(PopulateMessages.java:13) Caused by: java.lang.NullPointerException at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:167) at org.hibernate.cfg.Environment.<clinit>(Environment.java:585) ... 6 more
|