第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

hibernate 配置二級緩存的時(shí)候 出現(xiàn)沒有EhCacheMessageLogger.<init>()方法的錯(cuò)誤

hibernate 配置二級緩存的時(shí)候 出現(xiàn)沒有EhCacheMessageLogger.<init>()方法的錯(cuò)誤

落子鳶 2017-04-08 19:13:18
具體堆棧信息如下:java.lang.ExceptionInInitializerError?at cn.luoziyuan.util.HibernateUtil.buildSessionFactory(HibernateUtil.java:21)?at cn.luoziyuan.util.HibernateUtil.<clinit>(HibernateUtil.java:9)?at MyTest.test1(MyTest.java:25)?at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)?at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)?at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)?at java.lang.reflect.Method.invoke(Unknown Source)?at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)?at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)?at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)?at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)?at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)?at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)?at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)?at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)?at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)?at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)?at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)?at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)?at org.junit.runners.ParentRunner.run(ParentRunner.java:363)?at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)?at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)?at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)?at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)?at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)?at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.cache.spi.RegionFactory]?at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:261)?at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:225)?at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)?at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:295)?at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2444)?at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2440)?at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)?at cn.luoziyuan.util.HibernateUtil.buildSessionFactory(HibernateUtil.java:15)?... 25 moreCaused by: org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.ehcache.EhCacheMessageLogger]?at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:101)?at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:46)?at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:105)?at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:251)?... 32 moreCaused by: java.lang.NoSuchMethodException: org.hibernate.cache.ehcache.EhCacheMessageLogger.<init>()?at java.lang.Class.getConstructor0(Unknown Source)?at java.lang.Class.getConstructor(Unknown Source)?at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:97)?... 35 more下面是我導(dǎo)入的包的列表:這是sessionfactory的配置文件<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-configuration PUBLIC??????? "-//Hibernate/Hibernate Configuration DTD 3.0//EN"??????? "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"><hibernate-configuration>??? <session-factory>??????? <property name="connection.driver_class">com.mysql.jdbc.Driver</property>??????? <property name="connection.url">jdbc:mysql://localhost:3306/employee</property>??????? <property name="connection.username">root</property>??????? <property name="connection.password">1029</property>??????? <!-- JDBC connection pool (use the built-in) -->??????? <property name="connection.pool_size">1</property>??????? <!-- SQL dialect -->??????? <property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>??????? <!-- Enable Hibernate's automatic session context management -->??????? <property name="current_session_context_class">thread</property>?????????????? <!-- Echo all executed SQL to stdout -->??????? <property name="show_sql">true</property>??????? <property name="format_sql">true</property>??????? <!-- Drop and re-create the database schema on startup -->??????? <property name="hbm2ddl.auto">updata</property>??????? <property name="hibernate.cache.use_second_level_cache">true</property>??????? <property name="hibernate.cache.region.factory_class" >org.hibernate.cache.ehcache.EhCacheMessageLogger</property>??????? <mapping? resource="cn/luoziyuan/entity/Person.hbm.xml"></mapping>??????? <mapping resource="cn/luoziyuan/entity/Address.hbm.xml"></mapping>??????? <class-cache usage="read-only" class="cn.luoziyuan.entity.Person"/>?????? ??????? ??? </session-factory>?? </hibernate-configuration>希望各位大神能給出解決的方案
查看完整描述

1 回答

?
落子鳶

TA貢獻(xiàn)2條經(jīng)驗(yàn) 獲得超2個(gè)贊

通過排查基本上斷定是hibernate-tools的3.3.1版本不支持新的ehcache配置方式導(dǎo)致的。因?yàn)樵谖业膆ibernate.cgf.xml中,使用的是<property name="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</property>來配置ehcache的,這是ehcache新的配置方式,從異常的層級關(guān)系上看,應(yīng)該是hibernate-tools插件本身不支持這配制方式,改用<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</property>來配制后問題解決。

查看完整回答
1 反對 回復(fù) 2017-04-08
  • 1 回答
  • 0 關(guān)注
  • 2861 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號