-->
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.  [ 8 posts ] 
Author Message
 Post subject: instantiate CacheProvider:net.sf.hibernate.cache.EhCache
PostPosted: Wed Oct 27, 2004 8:17 am 
Regular
Regular

Joined: Fri Oct 08, 2004 4:11 am
Posts: 78
Location: Nottingham, England
Hi,
I am using JBoss 3.2.6 and get the following error:

could not instantiate CacheProvider: net.sf.hibernate.cache.EhCache

when I try to use EhCache in Hibernate. I have placed ehcache-1.0.jar in:

/default/deploy/lib/

Is this the correct place to put the jar file?


regards


Andrew


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 8:34 am 
Newbie

Joined: Wed Oct 27, 2004 6:05 am
Posts: 6
Put it in

server/default/lib

would do the trick.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 9:06 am 
Regular
Regular

Joined: Fri Oct 08, 2004 4:11 am
Posts: 78
Location: Nottingham, England
Hi,
my original message was incorrect in terms of the location of where the jar is placed. It is placed in the directory you mention:

/default/deploy/lib

but still I get the error:

java.lang.ClassNotFoundException: No ClassLoaders found for: net.sf.hibernate.cache.EhCache

Any ideas?


regards


Andrew


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 10:08 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Quote:
my original message was incorrect in terms of the location of where the jar is placed. It is placed in the directory you mention:

/default/deploy/lib


That's not the directory mentioned. I am pretty sure that in the existing code, the jar would need to be placed into server/yourconfigset/lib.

Note that I am in the process of committing changes to the way the Hibernate integration code gets deployed. It will now be an expanded .deployer service archive (.deployer is a new concept in 4.0 and above, but is essentially a .sar). So in that set up, you would just drop it into the server/yourconfigset/deploy/jboss-hibernate.deployer directory


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 10:42 am 
Regular
Regular

Joined: Fri Oct 08, 2004 4:11 am
Posts: 78
Location: Nottingham, England
I placed the jar in /server/default/lib and added a further line to my hibernate-service.xml:

<attribute name="CacheProviderClass">net.sf.hibernate.cache.EhCacheProvider</attribute>

then restarted the service, but I am still getting the following mbean error message:

MBeans waiting for other MBeans:
ObjectName: jboss.har:service=Hibernate
state: FAILED
I Depend On: jboss.jca:service=LocalTxCM,name=PostgresDS

Depends On Me: MBeanException: net.sf.hibernate.HibernateException: could not instantiate CacheProvider: net.sf.hibernate.cache.EhCacheProvider
Cause: net.sf.hibernate.HibernateException: could not instantiate CacheProvider: net.sf.hibernate.cache.EhCacheProvider

MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
ObjectName: jboss.har:service=Hibernate
state: FAILED
I Depend On: jboss.jca:service=LocalTxCM,name=PostgresDS

Depends On Me: MBeanException: net.sf.hibernate.HibernateException: could not instantiate CacheProvider: net.sf.hibernate.cache.EhCacheProvider
Cause: net.sf.hibernate.HibernateException: could not instantiate CacheProvider: net.sf.hibernate.cache.EhCacheProvider

Any further ideas anyone?


regards


Andrew


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 1:50 pm 
Regular
Regular

Joined: Fri Oct 08, 2004 4:11 am
Posts: 78
Location: Nottingham, England
steve wrote:
Quote:
Note that I am in the process of committing changes to the way the Hibernate integration code gets deployed. It will now be an expanded .deployer service archive (.deployer is a new concept in 4.0 and above, but is essentially a .sar). So in that set up, you would just drop it into the server/yourconfigset/deploy/jboss-hibernate.deployer directory



Steve, when is this feature to be made public?


regards


Andrew


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 8:20 pm 
Newbie

Joined: Wed Oct 27, 2004 6:05 am
Posts: 6
Quote:
I Depend On: jboss.jca:service=LocalTxCM,name=PostgresDS


Just remove the line
Code:
<depends>jboss.jca:name=PostgresDS, service=LocalTxCM</depends>

from your config file. It just works without this line for me, I don't know why the book "Hibernate in Action" said that the hibernate mbean depends on this. In JBoss 4, it never works with this dependency. I have not tested with 3.x.

Somehow, the loading and deploying order is not right.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 9:46 pm 
Regular
Regular

Joined: Fri Oct 08, 2004 4:11 am
Posts: 78
Location: Nottingham, England
I have removed the <depends> line and changed <attribute name="CacheProviderClass">net.sf.ehcache.hibernate.Provider</attribute> in my hibernate-service.xml file but I still get the following error:

[Configurator] No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/Library/jboss-4.0.0/server/default/lib/ehcache-1.0.jar!/ehcache-failsafe.xml

On the ehcache website it says:

'Ehcache comes with a failsafe configuration declared in the ehcache-failsafe.xml file, which is provided in the ehcache.jar. It is only used when no ehcache.xml configuration file is found in the classpath, and CacheManager is created without any arguments. If it is used a log warning level message will be issued.'

which is why I placed ehcache.xml in the following directory:

jboss-4.0.0/server/default/lib/

which is my classpath right/wrong? but yet the xml file cannot be seen. Seems to me that this may be a bug!

regards


Andrew


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