[英]Simple ehcache project exception
I'm currently converting some projects to maven and have been getting issues when the wars are started up. 我目前正在将一些项目转换为Maven,并且在战争爆发时遇到了问题。 So I just created a very simple ehcache maven project and I'm getting a class loader type of issue.
因此,我刚刚创建了一个非常简单的ehcache maven项目,并且遇到了类加载器的问题。 Here is my pom:
这是我的pom:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>MVCTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<spring.version>3.2.4.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- Spring 3 dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.ehcache-spring-annotations</groupId>
<artifactId>ehcache-spring-annotations</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
<build>
<finalName>SpringMVC</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
Spring config: http://www.springframework.org/schema/beans 春季配置:http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd "> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring- context-3.0.xsd http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-弹簧1.1.xsd “>
<context:component-scan base-package="com.test.common.controller" />
<ehcache:annotation-driven />
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
<property name="cacheManager" ref="ehcache" />
</bean>
<bean id="ehcache"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="/WEB-INF/ehcache.xml" />
</bean>
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
I litterally have a HelloWorld type of mvc setup without using ehcache in the springmvc part yet. 我以前在springmvc部分中没有使用ehcache,但具有HelloWorld类型的mvc设置。
This is the exception thrown: SEVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloController' defined in file [C:\\Users\\umxa894\\workspace\\Spring.metadata.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\MVCTest\\WEB-INF\\classes\\com\\test\\common\\controller\\HelloController.class]: Initialization of bean failed; 抛出此异常:SEVERE:上下文初始化失败org.springframework.beans.factory.BeanCreationException:创建文件[C:\\ Users \\ umxa894 \\ workspace \\ Spring.metadata.plugins \\ org中定义的名称为'helloController'的bean时出错。 eclipse.wst.server.core \\ tmp0 \\ wtpwebapps \\ MVCTest \\ WEB-INF \\ classes \\ com \\ test \\ common \\ controller \\ HelloController.class]:Bean初始化失败; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.googlecode.ehcache.annotations.config.internalEhCacheCachingAdvisor': Cannot resolve reference to bean 'com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut#0' while setting bean property 'pointcut';
嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为'com.googlecode.ehcache.annotations.config.internalEhCacheCachingAdvisor'的bean时出错:无法解析对bean'com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut#的引用设置bean属性“ pointcut”时为0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut#0': Cannot resolve reference to bean 'com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0' while setting bean property 'cacheAttributeSource';
嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建名称为com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut#0'的bean时出错:无法解析对bean com.googlecode.ehcache.annotations.impl的引用。设置bean属性'cacheAttributeSource'时的CacheAttributeSourceImpl#0'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0': Initialization of bean failed;
嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建名称为'com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0'的bean时出错:bean的初始化失败; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.cache.ehcache.EhCacheCacheManager' to required type 'net.sf.ehcache.CacheManager' for property 'cacheManager';
嵌套异常是org.springframework.beans.ConversionNotSupportedException:无法将类型“ org.springframework.cache.ehcache.EhCacheCacheManager”的属性值转换为属性“ cacheManager”的必需类型“ net.sf.ehcache.CacheManager”; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.cache.ehcache.EhCacheCacheManager] to required type [net.sf.ehcache.CacheManager] for property 'cacheManager': no matching editors or conversion strategy found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework
嵌套异常是java.lang.IllegalStateException:无法将类型“ org.springframework.cache.ehcache.EhCacheCacheManager”的值转换为属性“ cacheManager”的必需类型[net.sf.ehcache.CacheManager]:未找到匹配的编辑器或转换策略在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)在org.springframework.beans.factory org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)的org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:295) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)上的org.springframework .beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:15
.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)在org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext .java:479),位于org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389),位于org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294),位于org.springframework.web。 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)处的context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:15 59) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.googlecode.ehcache.annotations.config.internalEhCacheCachingAdvisor': Cannot resolve reference to bean 'com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut#0' while setting bean property 'pointcut';
59)在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1549)在java.util.concurrent.FutureTask.run(未知源)在java.util.concurrent.ThreadPoolExecutor.runWorker(未知源) )在java.lang.Thread.run(未知源)处java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知源)原因:org.springframework.beans.factory.BeanCreationException:创建名称为'com的bean时出错。 googlecode.ehcache.annotations.config.internalEhCacheCachingAdvisor':设置bean属性“ pointcut”时,无法解析对bean“ com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut#0”的引用; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut#0': Cannot resolve reference to bean 'com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0' while setting bean property 'cacheAttributeSource';
嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建名称为com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut#0'的bean时出错:无法解析对bean com.googlecode.ehcache.annotations.impl的引用。设置bean属性'cacheAttributeSource'时的CacheAttributeSourceImpl#0'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0': Initialization of bean failed;
嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建名称为'com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0'的bean时出错:bean的初始化失败; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.cache.ehcache.EhCacheCacheManager' to required type 'net.sf.ehcache.CacheManager' for property 'cacheManager';
嵌套异常是org.springframework.beans.ConversionNotSupportedException:无法将类型“ org.springframework.cache.ehcache.EhCacheCacheManager”的属性值转换为属性“ cacheManager”的必需类型“ net.sf.ehcache.CacheManager”; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.cache.ehcache.EhCacheCacheManager] to required type [net.sf.ehcache.CacheManager] for property 'cacheManager': no matching editors or conversion strategy found at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.Abstra
嵌套异常是java.lang.IllegalStateException:无法将类型“ org.springframework.cache.ehcache.EhCacheCacheManager”的值转换为属性“ cacheManager”的必需类型[net.sf.ehcache.CacheManager]:未找到匹配的编辑器或转换策略在org.springframework.beans.factory.support.BeanDefinitionValueResolver.java:329处在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)在org.springframework.beans.factory org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128)上的.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387)在org.springframework.beans.factory.support.AbstractAutowireCapableBean(Domain.do .java:519),网址为org.springframework.beans.factory.support.Abstra ctAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:86) at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:101) at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87) at org.springframework.aop.framework.autoproxy.Ab
org.springframework.beans.beans.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.org)上的ctAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)在org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:295) :223)在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)在org.springframework。 org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator。在org.springframework.aop.framework.autoproxy.Ab的findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87) stractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:69) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:409) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1488) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) ... 20 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut#0': Cann
stractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:69)在org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)在org.springframework.aop.framework.autoproxy.Abstract。 322),位于org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1488)的org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:409) .factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)... 20更多原因:org.springframework.beans.factory.BeanCreationException:创建名称为'com.googlecode.ehcache.annotations.impl.CacheStaticMethodMatcherPointcut的bean时出错#0':坎恩 ot resolve reference to bean 'com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0' while setting bean property 'cacheAttributeSource';
在设置bean属性“ cacheAttributeSource”时,解析对bean“ com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0”的引用; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0': Initialization of bean failed;
嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建名称为'com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0'的bean时出错:bean的初始化失败; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.cache.ehcache.EhCacheCacheManager' to required type 'net.sf.ehcache.CacheManager' for property 'cacheManager';
嵌套异常是org.springframework.beans.ConversionNotSupportedException:无法将类型“ org.springframework.cache.ehcache.EhCacheCacheManager”的属性值转换为属性“ cacheManager”的必需类型“ net.sf.ehcache.CacheManager”; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.cache.ehcache.EhCacheCacheManager] to required type [net.sf.ehcache.CacheManager] for property 'cacheManager': no matching editors or conversion strategy found at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.Abstra
嵌套异常是java.lang.IllegalStateException:无法将类型“ org.springframework.cache.ehcache.EhCacheCacheManager”的值转换为属性“ cacheManager”的必需类型[net.sf.ehcache.CacheManager]:未找到匹配的编辑器或转换策略在org.springframework.beans.factory.support.BeanDefinitionValueResolver.java:329处在org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)在org.springframework.beans.factory org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128)上的.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387)在org.springframework.beans.factory.support.AbstractAutowireCapableBean(Domain.do .java:519),网址为org.springframework.beans.factory.support.Abstra ctAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323) ... 38 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0': Initialization of bean failed;
org.springframework.beans.beans.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.org)上的ctAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)在org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:295) :223)在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)在org.springframework。 beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323)... 38更多原因:org.springframework.beans.factory.BeanCreationException:创建名称为'com.googlecode.ehcache.annotations.impl的bean时出错。 CacheAttributeSourceImpl#0':Bean初始化失败; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.cache.ehcache.EhCacheCacheManager' to required type 'net.sf.ehcache.CacheManager' for property 'cacheManager';
嵌套异常是org.springframework.beans.ConversionNotSupportedException:无法将类型“ org.springframework.cache.ehcache.EhCacheCacheManager”的属性值转换为属性“ cacheManager”的必需类型“ net.sf.ehcache.CacheManager”; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.cache.ehcache.EhCacheCacheManager] to required type [net.sf.ehcache.CacheManager] for property 'cacheManager': no matching editors or conversion strategy found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework
嵌套异常是java.lang.IllegalStateException:无法将类型“ org.springframework.cache.ehcache.EhCacheCacheManager”的值转换为属性“ cacheManager”的必需类型[net.sf.ehcache.CacheManager]:未找到匹配的编辑器或转换策略在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)在org.springframework.beans.factory org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)的org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:295) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)上的org.springframework .beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323) ... 48 more Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.cache.ehcache.EhCacheCacheManager' to required type 'net.sf.ehcache.CacheManager' for property 'cacheManager';
.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323)... 48更多原因:org.springframework.beans.ConversionNotSupportedException:无法转换类型为org.springframework.cache.ehcache.EhCacheCacheManager的属性值'设置为属性'cacheManager'所需的'net.sf.ehcache.CacheManager'类型; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.cache.ehcache.EhCacheCacheManager] to required type [net.sf.ehcache.CacheManager] for property 'cacheManager': no matching editors or conversion strategy found at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:463) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:494) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:488) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1433) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1392) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128) at org.springframework.beans.factory.
嵌套异常是java.lang.IllegalStateException:无法将类型“ org.springframework.cache.ehcache.EhCacheCacheManager”的值转换为属性“ cacheManager”的必需类型[net.sf.ehcache.CacheManager]:未找到匹配的编辑器或转换策略在org.springframework.beans.BeanWrapperImpl.convertForProperty(org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:463)在org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:494)在org.springframework.beans.BeanWrapperImpl.convertForProperty )在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1433)在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1392)在org.spring。 org.springframework.beans.factory上的factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128)。 support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) ... 54 more Caused by: java.lang.IllegalStateException: Cannot convert value of type [org.springframework.cache.ehcache.EhCacheCacheManager] to required type [net.sf.ehcache.CacheManager] for property 'cacheManager': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:264) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:448) ... 60 more
support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)... 54更多原因:java.lang.IllegalStateException:无法将[org.springframework.cache.ehcache.EhCacheCacheManager]类型的值转换为所需的类型[net.sf。 ehcache.CacheManager]用于属性“ cacheManager”:在org.springframework.beans.Beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:448 )... 60另外
What am I missing? 我想念什么? I'm assuming it is something simple, but my project looks like almost all hello world type of configs for a simple ehcache project.
我假设这很简单,但是我的项目看起来像一个简单的ehcache项目的几乎所有hello世界类型的配置。
Spring's EhCacheCacheManager
class acts as a wrapper for an EhCache CacheManager
instance. Spring的
EhCacheCacheManager
类充当EhCache CacheManager
实例的包装器。 EhCacheManagerFactoryBean
generates beans that are already wrapped in an EhCacheCacheManager
object. EhCacheManagerFactoryBean
生成已包装在EhCacheCacheManager
对象中的EhCacheCacheManager
。 So basically you're trying to wrap an object that's already wrapped. 因此,基本上,您正在尝试包装已包装的对象。 Instead just create one bean (using the factory) and you should get what you want:
而是只创建一个bean(使用工厂),您应该得到想要的东西:
<bean id="cacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="/WEB-INF/ehcache.xml" />
</bean>
If you need to reference the EhCache CacheManager
instance, it is available on the getCacheManager()
field of this cacheManager
bean. 如果您需要引用EhCache
CacheManager
实例,则此cacheManager
bean的getCacheManager()
字段上提供了该cacheManager
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.