-->
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: error while configuring hibernate second level cache
PostPosted: Fri Jul 29, 2011 12:13 am 
Newbie

Joined: Thu Jul 28, 2011 11:52 pm
Posts: 3
hi all, and thanks in advance if u post any reply.

i am configuring my hibernate from "hibernate-common.cfg.xml" file, right now we have not implemented any hibernate caching techniques in our project i am the first one trying to implement to enhance performance.

so i am trying to use second level cache by putting these tags inside "hibernate-common.cfg.xml"

<property name="cache.user_second_level_cache">true</property>
<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>

but at configuration time i am getting an error (i am sure it is an error, because i tried to catch it with exception but the control was not coming to the catch block, but with throwable it is coming).

the error given is

tried to access method net.sf.ehcache.CacheManager.<init>()V from class hibernate.cache.EhCacheProvider

so it will be a great help if anyone can please suggest something.

Cheers

Jamal


Top
 Profile  
 
 Post subject: Re: error while configuring hibernate second level cache
PostPosted: Fri Jul 29, 2011 12:26 am 
Newbie

Joined: Fri Jul 29, 2011 12:09 am
Posts: 1
Firstly property name you are using in hibernate config is incorrect it should be hibernate.cache.use_second_level_cache instead of user_second_level_cache

Code:
<property name="hibernate.cache.use_second_level_cache">true</property>


Second you need to check which version of hibernate you are using
For Hibernate 3.3 and higher
Code:
<property name="hibernate.cache.region.factory_class">
              net.sf.ehcache.hibernate.EhCacheRegionFactory</property>


And for Hibernate 3.0 - 3.2
Code:
<property name="hibernate.cache.provider_class">
              net.sf.ehcache.hibernate.EhCacheProvider</property>

_________________
Regards,
Rahul


Top
 Profile  
 
 Post subject: Re: error while configuring hibernate second level cache
PostPosted: Sat Jul 30, 2011 12:45 am 
Newbie

Joined: Thu Jul 28, 2011 11:52 pm
Posts: 3
hi

rahul thanks for the reply, i made a typing mistake about the property.

i got the solution, i was using an older version of ehcache-1.1.jar, that was the issue.

i am using ehcache-1.2.3.jar now its working fine.

thanks, god bless

jamal


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.