aspose file tools*
The moose likes Object Relational Mapping and the fly likes Hibernate  java.lang.ClassNotFoundException: javax.persistence.Cacheable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate  java.lang.ClassNotFoundException: javax.persistence.Cacheable" Watch "Hibernate  java.lang.ClassNotFoundException: javax.persistence.Cacheable" New topic
Author

Hibernate java.lang.ClassNotFoundException: javax.persistence.Cacheable

David Mbura
Ranch Hand

Joined: Apr 06, 2010
Posts: 65
Hello guys
I am working on a basic application with Hibernate 3.5,i m using JPA Annotations.I use Eclipse and everything running on jdk 1.6_u21.
Jar files from Hibernate are as follows


Hibernate3.jar
antlr
commons-collections
dom4j
javaassist
jta
slf4j
cglib
hibernate-annotations
ejb3-persistence
hibernate-common-annotations
log4j
slf4j-log4j12

and i am getting this exception

Thank you in advance
dominic steward
Greenhorn

Joined: Sep 11, 2010
Posts: 1
I had same problem.
got it solved when i used hibernate-jpa-2.0-api-1.0.0.Final found at hibernate-distribution-3.5.3-Final\lib\jpa.
PS:i was using JPA (javax.persistence.Entity) annotation
David Mbura
Ranch Hand

Joined: Apr 06, 2010
Posts: 65
Thanks dominic, it worked,i appreciate it!
jatinkumar patel
Greenhorn

Joined: Apr 19, 2009
Posts: 23
Thanks Dominic it Helped.
Amri Firdaus
Greenhorn

Joined: Jan 28, 2010
Posts: 4
thanks Dominic...it helped n it realy worked
Vinicius Alves
Greenhorn

Joined: Dec 21, 2010
Posts: 14
thanks dominic , it worked perfectly !
Keertiraj Patil
Greenhorn

Joined: Dec 18, 2011
Posts: 1
Thanks Dominic. It worked for me.
Roger Pack
Greenhorn

Joined: Aug 24, 2011
Posts: 4
This *might* have been fixed by not deploying two separate conflicting versions of hibernate-annotations or commons jar. Maybe, I'm not sure.
Dilruk Perera
Greenhorn

Joined: May 12, 2012
Posts: 3
Thanks dominic It really works so any body with this same problem can try dis out
Mario Schwaiger
Greenhorn

Joined: Jun 14, 2010
Posts: 11
Actually... For me that didn't work.

But luckily I had an old version of my pom.xml which was working. The error drove almost crazy. I stared to add more and more unnecessary libraries and always the same error:
java.lang.ClassNotFoundException: javax.persistence.NamedStoredProcedureQuery


The current version of hibernate-core is: 4.1.7.Final
But if you choose this version together with some other up-to-date jars you'll get a ClassNotFoundException. Use an older one and everything will be fine.
If you got to this page with the same troubles as I had, feel free to copy my pom...


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate java.lang.ClassNotFoundException: javax.persistence.Cacheable
 
Similar Threads
Hibernate configuration problem
Java Security Exception
HibernateException
Problem in AnnotationSessionFactoryBean crration.
Problem configuring Hibernate and JPA in Eclipse