wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Hibernate: configuring classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate: configuring classpath" Watch "Hibernate: configuring classpath" New topic
Author

Hibernate: configuring classpath

Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2841
    
  11

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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate: configuring classpath
 
Similar Threads
java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from
Trouble setting up Hibernate with Struts in Eclipse
Bugged with slf4j
Hibernate 3.3.1 setup help!
Upgrading to a new version of Hibernate under Eclipse