• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate: configuring classpath  RSS feed

Greg Charles
Posts: 3015
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!