This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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

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


and i am getting this exception

Thank you in advance
dominic steward

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

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

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

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

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

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

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

Joined: Jun 14, 2010
Posts: 14
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:

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...

It is sorta covered in the JavaRanch Style Guide.
subject: Hibernate java.lang.ClassNotFoundException: javax.persistence.Cacheable