-->
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: Hibernate3.5+Eclipse Galileo+Postgresql 8.4
PostPosted: Thu Aug 12, 2010 6:31 am 
Newbie

Joined: Thu Aug 12, 2010 5:45 am
Posts: 2
Hi Volks,
I encountered a problem while trying to setup Hibernate and Postgresql on Eclipse. The following Exception was obtained when i tried to run the java code:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/persistence/Cacheable
at org.hibernate.cfg.AnnotationBinder.determineCacheSettings(AnnotationBinder.java:953)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:596)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:636)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:359)
at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:838)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:128)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:91)
at com.hibernate.chapter1.TestEmployee.main(TestEmployee.java:16)
Caused by: java.lang.ClassNotFoundException: javax.persistence.Cacheable
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 8 more

Well here is some more inside on what i did.
Firstly, i started by installing my postgresql 8.4 and successfully linked it with Eclipse over the Database Development Interface.
Then i went ahead to link up Eclipse and Hibernate by creating a User Library containing the following jar files:
* hibernate3.jar
* antlr-2.7.6.jar
* commons-collections-3.1.jar
* dom4j-1.6.1.jar
* javassist.3.9.0.GA.jar
* jta.1.1.jar
* slf4j-api-1.5.8.jar
* cglib-2.2.jar
* hibernate-annotations.jar
* ejb3-persistence.jar
* hibernate-commons-annotations.jar
* log4j.jar
* slf4j-log4j12.jar
* postgresql-8.4-701.jdbc4.jar

Furthermore, i created a connection between hibernate and the database by configuring the hibernate.cfg.xml file using my right database configuration parameters.

Well , i hope for help. I don't know what else to do about this Exception.
Thanks for showing some concern.


Top
 Profile  
 
 Post subject: Re: Hibernate3.5+Eclipse Galileo+Postgresql 8.4
PostPosted: Thu Sep 02, 2010 12:01 pm 
Newbie

Joined: Thu Dec 18, 2008 1:40 pm
Posts: 8
I got the same exact error. Got it resolved by adding jpa-api-2.0-cr-1.jar in the build path. Got the jar from http://repository.jboss.org/maven2/org/ ... i/2.0-cr-1

Hope this helps.


Top
 Profile  
 
 Post subject: Re: Hibernate3.5+Eclipse Galileo+Postgresql 8.4
PostPosted: Tue Oct 05, 2010 11:41 am 
Newbie

Joined: Thu Aug 12, 2010 5:45 am
Posts: 2
Thank you so much sir...
Adding that jar file resolved the problem like a charm.
More to that, there was also an issue with the configuration file, which i also resolved by adding the path to localhost.
Now real work can begin...
Thanks again for the .jar file (link).


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.