-->
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: problem with Hibernate tutorial in docs
PostPosted: Fri Nov 14, 2008 2:25 pm 
Newbie

Joined: Fri Nov 14, 2008 2:12 pm
Posts: 7
Location: new york
I am trying to compile the HibernateUtil.java file which is specified in the Hibernate tutorial (in the install package). I am getting an error: package org.hibernate.cfg does not exist.
Here is the complete sourcecode of this file:
package util;
import org.hibernate.*;
import org.hibernate.cfg.*;
public class HibernateUtil {
private static final SessionFactory sessionFactory;
static {
try {
// Create the SessionFactory from hibernate.cfg.xml
sessionFactory = new
Configuration().configure().buildSessionFactory();
} 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);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
}



Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 14, 2008 3:20 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
Well, I assure you that the package org.hibernate.cfg does exist.
Are you sure that the hibernate jar is in your classpath?

_________________
Gonzalo Díaz


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 19, 2008 4:14 pm 
Newbie

Joined: Fri Nov 14, 2008 2:12 pm
Posts: 7
Location: new york
gonzao_diaz wrote:
Well, I assure you that the package org.hibernate.cfg does exist.
Are you sure that the hibernate jar is in your classpath?

Yeah, hibernate3.jar is in my classpath environment variable.
Actually it works now. It was a matter of rebooting the machine after setting the jar classpath.


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.