-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: I don't get it up
PostPosted: Wed May 23, 2007 1:01 pm 
Newbie

Joined: Wed May 23, 2007 12:50 pm
Posts: 2
Hi, I'm using

Hibernate 3.2.0 with Java 5 and Eclipse.
PostgreSQL 8.2
Win XP

I don't have any compile errors, but at runtime occurs the following error:


Initial SessionFactory creation failed.java.lang.NoClassDefFoundError:
javax/persistence/SqlResultSetMappings
Exception in thread "main" java.lang.ExceptionInInitializerError
at booksonline.util.HibernateUtil.<clinit>(HibernateUtil.java:16)
at booksonline.kap3.SaveUser.main(SaveUser.java:11)
Caused by: java.lang.NoClassDefFoundError: javax/persistence/SqlResultSetMappings
at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.<clinit>(EJB3OverridenAnnotationReader.java:135)
at org.hibernate.reflection.java.JavaXAnnotatedElement.<init>(JavaXAnnotatedElement.java:22)
at org.hibernate.reflection.java.JavaXClass.<init>(JavaXClass.java:24)
at org.hibernate.reflection.java.JavaXFactory$1.caseClass(JavaXFactory.java:179)
at org.hibernate.reflection.java.JavaXFactory$1.caseClass(JavaXFactory.java:188)
at org.hibernate.reflection.java.generics.TypeSwitch.doSwitch(TypeSwitch.java:19)
at org.hibernate.reflection.java.JavaXFactory.toXClass(JavaXFactory.java:173)
at org.hibernate.reflection.java.JavaXFactory.toXClass(JavaXFactory.java:83)
at org.hibernate.cfg.AnnotationConfiguration.addAnnotatedClass(AnnotationConfiguration.java:133)
at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:458)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1555)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1534)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1508)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1428)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1414)
at booksonline.util.HibernateUtil.<clinit>(HibernateUtil.java:12)
... 1 more



I use the following main class:

public class SaveUser {
public static void main(String[] args) {
User user = new User("Horst", "Hans", "Horst@Hans.de");
Session session = HibernateUtil.getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
session.persist(user);
tx.commit();
session.close();
}
}


I don't know why there can't be initialized a SessionFactory.
Can anybody help me out?


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 23, 2007 9:55 pm 
Senior
Senior

Joined: Sat Aug 19, 2006 6:31 pm
Posts: 139
You'll need the ejb3-persistence.jar in your runtime classpath. You can get it from the lib directory of the hibernate entitymanager download.

_________________
Don't forget to rate the reply if it helps..:)

Budyanto


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 24, 2007 4:05 am 
Newbie

Joined: Wed May 23, 2007 12:50 pm
Posts: 2
Thanks for your reply, but I already had included this file. Is there anything else which could cause the problem?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.