-->
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.  [ 6 posts ] 
Author Message
 Post subject: cache config error problem
PostPosted: Tue Dec 02, 2003 1:16 am 
Newbie

Joined: Thu Oct 16, 2003 5:02 am
Posts: 3
hi ,every one , i am may be a newer .
my problem is following

1 .context
tomcat 4.1.27 ,all libs hibernate needed put in the web-info/lib dir.

2. if not set cache in hibernate.prporites file , it works use the default ehcache and work fine,but if i set the
hibernate.cache.provider_class net.sf.hibernate.cache.HashtableCacheProvider or any other provider ,

error is following :
############################################

net.sf.hibernate.HibernateException: could not instantiate CacheProvider: net.sf.hibernate.cache.HashtableCacheProvider
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:115)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1072)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:718)
at com.fleety.invest.hibernate2.plugin.HibernatePlugIn.init(HibernatePlugIn.java:163)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1105)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:471)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3420)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2567)
at org.apache.catalina.loader.WebappLoader$WebappContextNotifier.run(WebappLoader.java:1369)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ClassNotFoundException: net/sf/hibernate/cache/HashtableCacheProvider
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:75)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:112)
... 12 more

############################################
i know the class file in the hibernate2.jar .and it MUST be there .
i also see the following warn

net.sf.hibernate.cache.CacheFactory - read-only cache configured for mutable:

i try hibernaterc version ,the problem keep the same
also try set the cglib to false , not work.

anybody can give me some advs ?
thanks


Top
 Profile  
 
 Post subject: used various cache providers
PostPosted: Tue Dec 02, 2003 1:59 am 
Regular
Regular

Joined: Sun Sep 21, 2003 11:43 pm
Posts: 85
Location: Massachusetts
I tried specifying HashTableCache and/or HashTableCacheProvider a few weeks ago and failed to figure out how to use it in Hibernate (v2.02, v2.03, and v2.1beta6) under Tomcat 4.1.24 (and .27 and .29).

I was able to use other cache providers such as:

1) net.sf.hibernate.cache.OSCacheProvider - requires oscache-2.0.1.jar.
2) net.sf.hibernate.cache.JCSCacheProvider - requires jcs.jar

I hope this helps. Personally, I'd like to know how to use the HashTableCacheProvider.

I hope this information helps.

Regards,
David


Top
 Profile  
 
 Post subject: Re: used various cache providers
PostPosted: Tue Dec 02, 2003 2:48 am 
Newbie

Joined: Thu Oct 16, 2003 5:02 am
Posts: 3
humble wrote:
I tried specifying HashTableCache and/or HashTableCacheProvider a few weeks ago and failed to figure out how to use it in Hibernate (v2.02, v2.03, and v2.1beta6) under Tomcat 4.1.24 (and .27 and .29).

I was able to use other cache providers such as:

1) net.sf.hibernate.cache.OSCacheProvider - requires oscache-2.0.1.jar.
2) net.sf.hibernate.cache.JCSCacheProvider - requires jcs.jar

I hope this helps. Personally, I'd like to know how to use the HashTableCacheProvider.

I hope this information helps.

Regards,
David


thanks a lot for your reply , i guess my problem keep no sense to the special provider,i also try the OSCacheProvider ,the same problem.

could you be kind give me some basic config info of you make the cache set in hibernate.properies file ?


Top
 Profile  
 
 Post subject: oscache you say?
PostPosted: Tue Dec 02, 2003 2:57 am 
Regular
Regular

Joined: Sun Sep 21, 2003 11:43 pm
Posts: 85
Location: Massachusetts
I forgot to mention you have to have an oscache.properties file in your WEB-INF/classes folder. Mine is empty (just one line with a pound comment). I got my oscache-2.0.1.jar file from:

http://www.opensymphony.com/oscache/download.html

I only reference oscache in one place in my hibernate configuration by setting the cache.provider_class to net.sf.hibernate.cache.OSCacheProvider. Of course, I'm a hibernate.cfg.xml proponent so if you use hibernate.properties, don't forget to name the property something like hibernate.cache.provider_class or something. :)

Good night and good luck,
David


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 02, 2003 3:49 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Guys, the CacheProvider framework is only available in 2.1. If you are using 2.1, net.sf.hibernate.cache.HashtableCacheProvider is certainly there (check the jar).

As to that warning, you should probably use mutable="false" for classes that you cache with usage="read-only".


Top
 Profile  
 
 Post subject: error problem
PostPosted: Tue Dec 02, 2003 4:56 am 
Newbie

Joined: Thu Oct 16, 2003 5:02 am
Posts: 3
i think i did not explain detail enough,

i CAN use the cache without any config set on the cache in the config file .hibernate use the default one

###########
2003-12-02 16:32:04,533 [Thread-15] WARN net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: ###########

it work great and have significant performance impove ,but i can not config it .

thanks to humble and gavin reply


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.