Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hibernate grails2.5&;SpringAcl:aclCacheManager bean不可访问_Hibernate_Grails_Ehcache - Fatal编程技术网

Hibernate grails2.5&;SpringAcl:aclCacheManager bean不可访问

Hibernate grails2.5&;SpringAcl:aclCacheManager bean不可访问,hibernate,grails,ehcache,Hibernate,Grails,Ehcache,从2.4.x迁移到上一个2.5.0版本后,我在datasource中更改了hibernate的一些参数: cache.region.factory_class = 'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory' 和Config.groovy: grails.cache.enabled = true grails.cache.clearAtStartup = true grails.hibernate.cache.queri

从2.4.x迁移到上一个2.5.0版本后,我在datasource中更改了hibernate的一些参数:

cache.region.factory_class =
'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory'
和Config.groovy:

grails.cache.enabled = true
grails.cache.clearAtStartup = true
grails.hibernate.cache.queries = false
beans.cacheManager.cacheManagerName = 'springcacheCacheManager'
beans.cacheManager.shared = true
在resources.groovy中,ehcache bean的设置如下:

ehcache(EhCacheFactoryBean) { bean ->
        cacheManager = ref("springcacheCacheManager")
        cacheName = "cache"
        eternal = false
        shared = true
        diskPersistent = false
        memoryStoreEvictionPolicy = "LRU"
        maxEntriesLocalHeap = "10000"
        timeToIdleSeconds = "120"
        timeToLiveSeconds = "120"
        maxEntriesLocalDisk = "10000000"
        diskExpiryThreadIntervalSeconds = "120"

    }
然后,带aclCacheManager的springAclService的问题出现在引导中:

objc[41029]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined. |Loading Grails
2.5.0 |Configuring classpath . |Environment set to development ................................. |Packaging Grails application ........... |Compiling 1 source files .................................................................Log4j consoleLevel: WARN appFile Level: DEBUG .. |Running Grails application objc[41057]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined. Log4j consoleLevel: WARN appFile Level: DEBUG Configuring Spring Security Core ... ... finished configuring Spring Security Core Configuring Spring Security ACL ... ... finished configuring Spring Security ACL 2015-03-28 18:53:44,111 ERROR [DefaultUrlMappingEvaluator$UrlMappingBuilder] - URL mapping argument [exception] with value [(*)] must be a valid class 2015-03-28 18:53:44,113 ERROR [DefaultUrlMappingEvaluator$UrlMappingBuilder] - URL mapping argument [exception] with value [(*)] must be a valid class 2015-03-28 18:53:45,342 ERROR [GrailsContextLoaderListener] - Error initializing the application: Error creating bean with name 'afterAclCollectionRead': Cannot resolve reference to bean 'aclService' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityAclAclService': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aclCache': Cannot resolve reference to bean 'ehcacheAclCache' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcacheAclCache': Cannot resolve reference to bean 'aclCacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aclCacheManager': Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name. The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'afterAclCollectionRead': Cannot resolve reference to bean 'aclService' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityAclAclService': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aclCache': Cannot resolve reference to bean 'ehcacheAclCache' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcacheAclCache': Cannot resolve reference to bean 'aclCacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aclCacheManager': Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name. The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityAclAclService': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aclCache': Cannot resolve reference to bean 'ehcacheAclCache' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcacheAclCache': Cannot resolve reference to bean 'aclCacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aclCacheManager': Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name. The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]     ... 4 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aclCache': Cannot resolve reference to bean 'ehcacheAclCache' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcacheAclCache': Cannot resolve reference to bean 'aclCacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aclCacheManager': Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name. The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]     ... 4 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehcacheAclCache': Cannot resolve reference to bean 'aclCacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aclCacheManager': Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name. The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]     ... 4 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aclCacheManager': Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name. The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]     ... 4 more Caused by: net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name. The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]     at net.sf.ehcache.CacheManager.assertNoCacheManagerExistsWithSameName(CacheManager.java:529)    at net.sf.ehcache.CacheManager.init(CacheManager.java:374)  at net.sf.ehcache.CacheManager.<init>(CacheManager.java:259)    ... 4 more Error |
objc[41029]:JavaLaunchHelper类在/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/Java和/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/libinstrument.dylib中都实现。将使用其中一个。哪一个是未定义的|装载圣杯
2.5.0 |配置类路径|发展的环境|包装Grails应用程序|编译1个源文件………..Log4j控制台级别:警告应用程序文件级别:调试|运行Grails应用程序objc[41057]:JavaLaunchHelper类在/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/Java和/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/libinstrument.dylib中实现。将使用其中一个。哪一个是未定义的。Log4j控制台级别:警告appFile级别:调试配置Spring安全内核。。。已完成配置Spring Security Core配置Spring Security ACL。。。已完成配置Spring安全ACL 2015-03-28 18:53:44111错误[DefaultUrlMappingEvaluator$UrlMappingBuilder]-值为[(*)]的URL映射参数[exception]必须是有效的类2015-03-28 18:53:44113错误[DefaultUrlMappingEvaluator$UrlMappingBuilder]-值为[(*)]的URL映射参数[exception]必须是有效类2015-03-28 18:53:45342错误[GrailContextLoaderListener]-初始化应用程序时出错:创建名为“afterAclCollectionRead”的bean时出错:设置构造函数参数时无法解析对bean“aclService”的引用;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“SpringSecurityACLService”的bean时出错:bean初始化失败;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“aclCache”的bean时出错:设置构造函数参数时无法解析对bean“ehcacheAclCache”的引用;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“ehcacheAclCache”的bean时出错:设置bean属性“cacheManager”时无法解析对bean“aclCacheManager”的引用;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“aclCacheManager”的bean时出错:调用init方法失败;嵌套异常为net.sf.ehcache.CacheException:同一VM中已存在另一个未命名的CacheManager。请在配置中为每个CacheManager提供唯一的名称,或执行以下操作之一:
1.使用CacheManager.create()静态工厂方法之一重用具有相同名称的相同CacheManager,或者在必要时创建一个
2.在创建具有相同名称的新cacheManager之前,请关闭先前的cacheManager。现有CacheManager的来源是:DefaultConfigurationSource[ehcache.xml或ehcache-failsafe.xml]org.springframework.beans.factory.BeanCreationException:创建名为“afterAclCollectionRead”的bean时出错:设置构造函数参数时无法解析对bean“aclService”的引用;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“SpringSecurityACLService”的bean时出错:bean初始化失败;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“aclCache”的bean时出错:设置构造函数参数时无法解析对bean“ehcacheAclCache”的引用;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“ehcacheAclCache”的bean时出错:设置bean属性“cacheManager”时无法解析对bean“aclCacheManager”的引用;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“aclCacheManager”的bean时出错:调用init方法失败;嵌套异常为net.sf.ehcache.CacheException:同一VM中已存在另一个未命名的CacheManager。请在配置中为每个CacheManager提供唯一的名称,或执行以下操作之一:
1.使用CacheManager.create()静态工厂方法之一重用具有相同名称的相同CacheManager,或者在必要时创建一个
2.在创建具有相同名称的新cacheManager之前,请关闭先前的cacheManager。现有CacheManager的源代码是:java.util.concurrent.FutureTask.run(FutureTask.java:266)处java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)处java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)处的DefaultConfigurationSource[ehcache.xml或ehcache-failsafe.xml]在java.lang.Thread.run(Thread.java:745)上,由以下原因引起:org.springframework.beans.factory.BeanCreationException:创建名为“springsecurityaclService”的bean时出错:bean初始化失败;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“aclCache”的bean时出错:设置构造函数参数时无法解析对bean“ehcacheAclCache”的引用;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“ehcacheAclCache”的bean时出错:设置bean属性“cacheManager”时无法解析对bean“aclCacheManager”的引用;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“aclCacheManager”的bean时出错:调用init方法失败;嵌套异常为net.sf.ehcache.CacheException:同一VM中已存在另一个未命名的CacheManager。请在配置中为每个CacheManager提供唯一的名称,或执行以下操作之一:
1.使用CacheManager.creat
 aclCacheManager(org.springframework.cache.ehcache.EhCacheManagerFactoryBean) {
  shared = true