-->
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.  [ 4 posts ] 
Author Message
 Post subject: could not instantiate CacheProvider
PostPosted: Thu Mar 10, 2005 12:05 pm 
Newbie

Joined: Mon Feb 21, 2005 1:46 pm
Posts: 3
Location: Minneapolis
I am new to Hibernate and trying to get simple load application to work.
I am using version 2.1.8 with Oracle9ias and when I start my application I get

net.sf.hibernate.HibernateException: could not instantiate CacheProvider: net.sf.hibernate.cache.EhCacheProvider

Any help is appretiated.

stack trace is below:

net.sf.hibernate.HibernateException: could not instantiate CacheProvider: net.sf.hibernate.cache.EhCacheProvider
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:145)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1172)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:803)
at com.epredix.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:19)
at com.epredix.hibernate.UserDAO.getUserById(UserDAO.java:15)
at com.epredix.asteroid.manager.hibernate.HibernateManager.loadUser(HibernateManager.java:13)
at com.epredix.asteroid.action.hibernate.UserAction.perform(UserAction.java:56)
at com.epredix.commons.framework.web.SimpleActionManager.dispatch(Simple
ActionManager.java:134)
at com.epredix.commons.framework.web.CommandServlet.doGetOrPost(CommandS
ervlet.java:174)
at com.epredix.commons.framework.web.CommandServlet.doPost(CommandServle
t.java:153)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletReque
stDispatcher.java:765)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Ser
vletRequestDispatcher.java:317)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
tHandler.java:790)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
va:270)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
va:112)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
sableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ClassCastException
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.ja
va:142)

_________________
Ilhami Topaloglu


Top
 Profile  
 
 Post subject: CacheProvider
PostPosted: Thu Mar 10, 2005 12:10 pm 
Beginner
Beginner

Joined: Wed Feb 23, 2005 9:24 am
Posts: 28
you must ensure yourself that ehcache.jar is in your classpath


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 12:31 pm 
Newbie

Joined: Mon Feb 21, 2005 1:46 pm
Posts: 3
Location: Minneapolis
Thanks you for the reply.

By unzipping the jar files I se that net.sf.hibernate.cache.EhCacheProvider is in the hibernate2.jar file and yes both ehcache-0.9.jar and hibernate2.jar files are in my class path.

_________________
Ilhami Topaloglu


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 1:45 pm 
Newbie

Joined: Mon Feb 21, 2005 1:46 pm
Posts: 3
Location: Minneapolis
here is some more info:

I created a simple HibernateUtil class to get session. The error happens in the buildSessionFactory method



/*
* Simple helper clas to obtain a new hibernate session
*/
public class HibernateUtil {

private static final SessionFactory sessionFactory;

static {
try {
Configuration configuration = new Configuration();
sessionFactory = configuration.configure().buildSessionFactory();
} catch (Throwable e) {
e.printStackTrace(System.out);
throw new ExceptionInInitializerError(e);
}
}

/*
* accessor method that returns a nes session
*/
public static Session getSession() throws HibernateException {
return sessionFactory.openSession();
}
}

_________________
Ilhami Topaloglu


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