org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge]

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory‘ defined in class path resource [beans4.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge]
at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:389)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:262)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)

原来配置写成<property name="hibernate.cache.provider_class">org.hibernate.catche.NoCacheProvide</property>

后来改成<property name="hibernate.cache.provider_class">org.hibernate.catche.EhCacheProvider</property>就正确了

时间: 2024-10-11 00:54:38

org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge]的相关文章

org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

使用Hibernate 插入List数据时出现了以下异常: 1 SLF4J: The requested version 1.6 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8] 2 SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details. 3 log4j:WARN No appenders co

Caused by: org.hibernate.HibernateException: Connection cannot be null when &#39;hibernate.dialect&#39; not

我手动配置hibernate4.3.4,测试的时候出现: Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set 我是按照官方文档配置的,但是官方文档的代码好像有点问题 这是官方文档里面的那个工具类的部分代码:return new Configuration().configure().buildSessionFactory( new Stand

Hibernate(三): org.hibernate.HibernateException: No CurrentSessionContext configured!

Hibernate版本5.2.9 获取Session的方式是sessionFactory.getCurrentSession(); 比较老一些的版本使用的是sessionFactory.openSession()是不管任何情况都重新开启一个Session. 从两者却别来说getCurrentSession();相对的增加了一个判断,在有Session的情况下就会直接去调用,没有session的话才会创建.比openSession()要好一点. 但是,目前却遇到了问题: 四月 15, 2017 1

使用hibernate时出现 org.hibernate.HibernateException: Unable to get the default Bean Validation factory

hibernate 在使用junit测试报错: org.hibernate.HibernateException: Unable to get the default Bean Validation factory at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:127) at org.hibernate.cfg.Configuration.appl

org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not

遇到这个问题之前,我去百度和谷歌去搜索了一下,发现各种说法,但是针对我的项目而言,也就是公司的项目而言,这个问题的根源并非是网上所说的那样. 最后是通过自己的想法做测试得到了解决. 1.首先说说我的配置吧!我的配置是通过spring自带的注解来实现 声明式事物管理的.如果我们没去了解spring的声明式事物管理的话,或许我们是得不出什么结论的. 如果你配置过声明式事物管理,你就知道spring是怎么帮你管理的. 2.spring声明式事物管理是在service层管理的,关于到sessionFac

spring+hibernate整合:报错org.hibernate.HibernateException: No Session found for current thread

spring+hibernate整合:报错信息如下 org.hibernate.HibernateException: No Session found for current thread at org.springframework.orm.hibernate4.SpringSessionContext.currentSession(SpringSessionContext.java:106) at org.hibernate.internal.SessionFactoryImpl.getC

异常:org.hibernate.HibernateException: &#39;hibernate.dialect&#39; must be set when no Connection available

spring整合hibernate报了这样一个异常,一直以为是dialect参数的问题,最后发现原来是配数据源时,数据库的名字写错了....... 找了半天,重新写了配置文件没出问题,但就不知道这个文件哪里出问题了.配置文件里面这种细节一定要注意. 版权声明:本文为博主原创文章,未经博主允许不得转载. 异常:org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection available

Caused by:org.hibernate.HibernateException:Unable to make JDBC Connection

1.错误描述 Caused by:org.hibernate.HibernateException:Unable to make JDBC Connection[jdbc\:mysql\://localhost\:3306/school] 2.错误原因 在hibernate.cfg.xml中配置数据库路径时 <property name="connection.url"> jdbc\:mysql://localhost\:3306/school </property&

分析 org.hibernate.HibernateException: No Session found for current thread

/**      *      * org.hibernate.HibernateException: No Session found for current thread      * 分析:getCurrentSession()和当前事务有关系      *      * Spring hibernate 事务的流程      *      * 1.在方法开始之前      *         ①.获取Session      *         ②.把Session 和当前线程绑定,这样