• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Issues adding hibernate-ehcache to Eclipse project

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 28394
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 28394
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you. This is the error I am getting.



I currently have these files in my .classpath

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic