-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate: configuring classpath
PostPosted: Mon Apr 13, 2009 11:16 pm 
Newbie

Joined: Mon Apr 13, 2009 11:09 pm
Posts: 3
I've worked with Hibernate before, but at the time it was already configured for the environment I was working with. I'm trying to refresh my knowledge of it by running through the "Hello, world!" example in "Java Persistence with Hibernate" (aka Hibernate in Action, 2nd ed.) I had a lot of trouble setting up the correct class path. I finally have it working, but I'm wondering why it was so hard.

I downloaded Hibernate 3.3.1 GA. According to the book, the lib directory should have readme.txt file that explains exactly what jars I need. There isn't such a file in 3.3.1, but rather three directories called bytecode, optional, and required. I created an Eclipse project with a lib directory into which I placed the hibernate3.jar from the root of the distribution, then all the jars in lib/required. That wasn't even enough though. Before I could get running, I had to go find commons-logging-1.0.4.jar and slf4j-simple-1.5.0.jar and add them to my project lib as well. (The lib/required directory contained an slf4j API jar, but apparently that wasn't enough.)

Why was this so hard? Did I do something wrong? Is there an easier way to get a basic Hibernate application running?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 13, 2009 11:55 pm 
Regular
Regular

Joined: Thu Sep 06, 2007 2:22 am
Posts: 108
Location: Noida,India
Book which you are reading "Java Persistence With Hibernate" was for 3.2.x, so it doesn't mean that nothing will work what is written in book, But in 3.3.1 GA a lot of think has change (with respect to the project set up).

I have added following JAR to set up the project with Hibernate 3.3.1 GA.
antlr-2.7.6.jar
commons-collections-3.1.jar
dom4j-1.6.1.jar
hibernate-cglib-repack-2.1_3.jar
hibernate3.jar
javassist-3.4.GA.jar
jta-1.1.jar
slf4j-api-1.5.2.jar
hsqldb.jar
log4j-1.2.15.jar
slf4j-log4j12-1.5.2.jar


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 14, 2009 1:00 am 
Newbie

Joined: Mon Apr 13, 2009 11:09 pm
Posts: 3
Thanks for the reply. Yes, I figured the book was a bit out of date, because, well ... it's a book. However, I find it strange that Hibernate lib/required directory doesn't, in fact, contain all the required libraries for a basic example program. That is strange, right?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 14, 2009 9:27 am 
Beginner
Beginner

Joined: Wed Aug 11, 2004 3:50 pm
Posts: 26
I experienced the same problem. Yes, it is strange, and yes you'd expect better... from a commercial product. It is open source, it does its job well, and it is free, so we can't really complain.

At the same time, I'm sure the people that build the distribution packages have heard of this one quite a few times. My guess is that they probably already fixed it and that we'll see the problem go away with the next GA release.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.