0 Replies Latest reply on Nov 1, 2004 2:53 PM by Mark LaPolla

    Could not instantiate CacheProvider: (Hibernate2 + JBoss4 us

    Mark LaPolla Newbie

      I keep running into the no suitable driver error message:

      10:52:06,270 INFO [DriverManagerConnectionProvider] using driver: com.microsoft.jdbc.sqlserver.SQLServerDriver at URL: jdbc:microsoft:sqlserver://localhost:1433;SelectMethod=cursor;DatabaseName=hibernate
      10:52:06,270 INFO [DriverManagerConnectionProvider] connection properties: {user=sa, password=4blueskies}
      10:52:06,598 INFO [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
      10:52:06,645 WARN [SettingsFactory] Could not obtain connection metadata
      java.sql.SQLException: No suitable driver
       at java.sql.DriverManager.getConnection(DriverManager.java:532)
       at java.sql.DriverManager.getConnection(DriverManager.java:140)
       at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:101)
       at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:73)
       at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
       at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
       at epm1.SessionManager.<init>(SessionManager.java:112)
       at epm1.SessionManager.getInstance(SessionManager.java:177)
       at epm1.common.processor.ApplicationEnvironment.initSessionManager(ApplicationEnvironment.java:405)
       at epm1.common.processor.ApplicationEnvironment.init(ApplicationEnvironment.java:162)
       at epm1.common.processor.ApplicationEnvironment.getInstance(ApplicationEnvironment.java:113)
       at epm1.struts.Epm1ActionServlet.initAppEnv(Epm1ActionServlet.java:50)
       at epm1.struts.Epm1ActionServlet.init(Epm1ActionServlet.java:65)
       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
       at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
       at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.apache.catalina.core.StandardContext.init(StandardContext.java:5441)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:336)
       at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:83)
       at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:370)
       at org.jboss.web.WebModule.startModule(WebModule.java:62)
       at org.jboss.web.WebModule.startService(WebModule.java:40)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:416)
       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy24.start(Unknown Source)
       at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:362)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:927)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
       at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(InvokerAdaptorService.java:250)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:775)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
       at sun.rmi.transport.Transport$1.run(Transport.java:148)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:534)
      10:52:06,723 INFO [SettingsFactory] Use scrollable result sets: false
      10:52:06,723 INFO [SettingsFactory] Use JDBC3 getGeneratedKeys(): false
      10:52:06,738 INFO [SettingsFactory] Optimize cache for minimal puts: false
      10:52:06,738 INFO [SettingsFactory] Query language substitutions: {no='N', true=1, yes='Y', false=0}
      10:52:06,738 INFO [SettingsFactory] cache provider: net.sf.hibernate.cache.EhCacheProvider
      


      but now I am getting the following as well:

      10:52:06,738 INFO [SettingsFactory] cache provider: net.sf.hibernate.cache.EhCacheProvider
      10:52:09,441 INFO [STDOUT] net.sf.hibernate.HibernateException: could not instantiate CacheProvider: net.sf.hibernate.cache.EhCacheProvider
       at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:134)
       at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
       at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
       at epm1.SessionManager.<init>(SessionManager.java:112)
       at epm1.SessionManager.getInstance(SessionManager.java:177)
       at epm1.common.processor.ApplicationEnvironment.initSessionManager(ApplicationEnvironment.java:405)
       at epm1.common.processor.ApplicationEnvironment.init(ApplicationEnvironment.java:162)
       at epm1.common.processor.ApplicationEnvironment.getInstance(ApplicationEnvironment.java:113)
       at epm1.struts.Epm1ActionServlet.initAppEnv(Epm1ActionServlet.java:50)
       at epm1.struts.Epm1ActionServlet.init(Epm1ActionServlet.java:65)
       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
       at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
       at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.apache.catalina.core.StandardContext.init(StandardContext.java:5441)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:336)
       at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:83)
       at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:370)
       at org.jboss.web.WebModule.startModule(WebModule.java:62)
       at org.jboss.web.WebModule.startService(WebModule.java:40)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:416)
       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy24.start(Unknown Source)
       at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:362)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:927)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
       at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(InvokerAdaptorService.java:250)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:775)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
       at sun.rmi.transport.Transport$1.run(Transport.java:148)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:534)
      Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: net.sf.hibernate.cache.EhCacheProvider
       at org.jboss.mx
      10:52:09,488 INFO [STDOUT] .loading.LoadMgr3.beginLoadTask(LoadMgr3.java:292)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:463)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:374)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:141)
       at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102)
       at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:131)
       ... 105 more
      10:52:51,676 INFO [DriverManagerConnectionProvider] cleaning up connection pool: jdbc:microsoft:sqlserver://localhost:1433;SelectMethod=cursor;DatabaseName=hibernate
      

      My hibernate.properties for caching are:
      ## enable the query cache
      
      hibernate.cache.use_query_cache true
      
      
      ## choose a cache implementation
      
      hibernate.cache.provider_class net.sf.hibernate.cache.EhCacheProvider
      #hibernate.cache.provider_class net.sf.hibernate.cache.EmptyCacheProvider
      #hibernate.cache.provider_class net.sf.hibernate.cache.HashtableCacheProvider
      #hibernate.cache.provider_class net.sf.hibernate.cache.TreeCacheProvider
      #hibernate.cache.provider_class net.sf.hibernate.cache.OSCacheProvider
      #hibernate.cache.provider_class net.sf.hibernate.cache.JCSCacheProvider
      #hibernate.cache.provider_class net.sf.hibernate.cache.SwarmCacheProvider
      


      Any ideas would be helpful.

      Thanks.