Coldfusion ORM:缓存配置出错

时间:2015-11-03 01:17:59

标签: hibernate coldfusion coldfusion-11

当我尝试在使用Coldfusion 11时将EHCache设置为ORM的缓存提供程序时出现以下错误:

  

org.hibernate.service.spi.ServiceException:无法创建请求的服务[org.hibernate.engine.spi.CacheImplementor]       at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:186)       在org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:150)       at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)       在org.hibernate.internal.SessionFactoryImpl。(SessionFactoryImpl.java:264)       在org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1743)       在coldfusion.orm.hibernate.HibernateConfiguration.buildSessionFactory(HibernateConfiguration.java:618)       at coldfusion.orm.hibernate.HibernateConfiguration.buildSessionFactory(HibernateConfiguration.java:602)       在coldfusion.orm.hibernate.HibernateProvider.InitializeORMForApplication(HibernateProvider.java:190)       在coldfusion.orm.hibernate.HibernateProvider.onPageRequestStart(HibernateProvider.java:147)       at coldfusion.filter.ApplicationFilter.firePageRequestStart(ApplicationFilter.java:644)       at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:449)       at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42)       at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)       at coldfusion.filter.PathFilter.invoke(PathFilter.java:142)       at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)       at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)       at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)       at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)       at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)       at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)       at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)       at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)       在coldfusion.CfmServlet.service(CfmServlet.java:219)       at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)       在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)       在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)       at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)       at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)       在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)       在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)       at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:121)       at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)       在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)       在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)       at sun.reflect.GeneratedMethodAccessor409.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)       at java.lang.reflect.Method.invoke(Unknown Source)       at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:97)       at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:472)       at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:312)       at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:192)       at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:507)       at com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36)       at sun.reflect.GeneratedMethodAccessor408.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)       at java.lang.reflect.Method.invoke(Unknown Source)       在com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:79)       at sun.reflect.GeneratedMethodAccessor407.invoke(Unknown Source)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)       at java.lang.reflect.Method.invoke(Unknown Source)       at com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:53)       at com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut $ 1.invoke(NewFilterChainPointCut.java:41)       在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java)       在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)       在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)       在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)       在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)       在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)       在org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:199)       at org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:607)       at org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint.java:314)       at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)       at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)       at org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61)       在java.lang.Thread.run(未知来源)   引起:org.hibernate.cache.CacheException:net.sf.ehcache.CacheException:另一个未命名的CacheManager已存在于同一个VM中。请为配置中的每个CacheManager提供唯一的名称,或执行以下操作之一:   1.使用CacheManager.create()静态工厂方法之一重用相同名称的相同CacheManager,或者根据需要创建一个   2.在创建具有相同名称的新缓存之前关闭先前的cacheManager。   现有CacheManager的来源是:DefaultConfigurationSource [ehcache.xml或ehcache-failsafe.xml]       在org.hibernate.cache.ehcache.EhCacheRegionFactory.start(EhCacheRegionFactory.java:110)       在org.hibernate.internal.CacheImpl。(CacheImpl.java:70)       在org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:40)       在org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:35)       at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:91)       at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:176)       ......还有66个   引起:net.sf.ehcache.CacheException:另一个未命名的CacheManager已经存在于同一个VM中。请为配置中的每个CacheManager提供唯一的名称,或执行以下操作之一:   1.使用CacheManager.create()静态工厂方法之一重用相同名称的相同CacheManager,或者根据需要创建一个   2.在创建具有相同名称的新缓存之前关闭先前的cacheManager。   现有CacheManager的来源是:DefaultConfigurationSource [ehcache.xml或ehcache-failsafe.xml]       at net.sf.ehcache.CacheManager.assertNoCacheManagerExistsWithSameName(CacheManager.java:529)       在net.sf.ehcache.CacheManager.init(CacheManager.java:374)       在net.sf.ehcache.CacheManager。(CacheManager.java:259)       在org.hibernate.cache.ehcache.EhCacheRegionFactory.start(EhCacheRegionFactory.java:94)       ... 71更多

这是我在Application.cfc中的ormSettings:

this.ormSettings = {
    datasource = "dummy",
    cfcLocation = ["/models"],
    dbCreate = "none",
    logSql = true,
    eventHandling = true,
    eventHandler = "cborm.models.EventHandler",
    autoRebuild = false,
    useDBForMapping = true,
    flustAtRequestEnd = false,
    autoManageSession = false,
    secondarycacheEnabled = true,
    cacheprovider = "ehcache",
    cacheconfig = "C:/Codebase/test/config/ehcache.xml"
};

这是ehcache.xml的内容:

<?xml version="1.0" encoding="UTF-8"?>
<ehcache>
    <diskStore path="C:/Codebase/test/tmp/ehcache"/>
    <defaultCache
        maxElementsInMemory="10000"
        eternal="false"
        timeToIdleSeconds="120"
        timeToLiveSeconds="120"
        overflowToDisk="true"
        diskPersistent="false"
        diskExpiryThreadIntervalSeconds="120"
        memoryStoreEvictionPolicy="LRU"
    />
</ehcache>

1 个答案:

答案 0 :(得分:0)

原来我只需要重启ColdFusion。哎呀.....