Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Issues adding hibernate-ehcache to Eclipse project

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I am trying to add 2nd level caching to an existing Eclipse project. It is using hibernate 3.6.0.final, so I added hibernate-ehcache-3.6.0.final, and ehcache-core-1.5.0. I added to my hibernateProperties the following lines,


But I get an exception when I run the code

java.lang.ClassNotFoundException: net.sf.ehcache.hibernate.EhCacheRegionFactory cannot be found

I've tried multiple things,

Tried upgrading to:
hibernate 3.6.10.final, hibernate-ehcache-3.6.10.final, and ehcache-core-2.4.3
, but I just got the same error.

I also tried changing

to

But I got the error: java.lang.ClassNotFoundException: net.sf.ehcache.CacheException cannot be found

I also tried

but go an error java.lang.ClassNotFoundException: net.sf.ehcache.hibernate.EhCacheProvider cannot be found


I'm using Windows 7, java 1.6, and Eclipse Kepler
Any clues would be appreciated.

Thanks.
 
Marshal
Posts: 24933
61
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jason, welcome to the Ranch!

Two questions:

Which jar is net.sf.ehcache.hibernate.EhCacheRegionFactory in?

And is that jar in your Eclipse project's build path?
 
Jason Trinity
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul,

net.sf.ehcache.hibernate.EhCacheRegionFactory is in ehcache-core-1.5.0.jar.

This is what my .classpath looks like


 
Jason Trinity
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is just frustrating. I tried switching to OSCache to see if I had any luck with it, but now I get



I hate Eclipse, but sadly this application depends on it.
 
Jason Trinity
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I upgraded my libraries to hibernate-ehcache-3.6.10.Final.jar, hibernate-core-3.6.10.Final.jar, and ehcache-2.4.3.jar and I still get the same error. It looks like Eclipse is not finding the class.
 
Paul Clapham
Marshal
Posts: 24933
61
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This seems to be a problem with Eclipse so I've moved the post into the IDEs forum, maybe more people will see it there.

Could you post the whole stack trace including the single line you posted already? That would provide more context for what's running and what's calling what.
 
Jason Trinity
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. This is the error I am getting.



I currently have these files in my .classpath

 
Whose rules are you playing by? This tiny ad doesn't respect those rules:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!