Я пытаюсь обновиться с весны 3.1 до весны 4.1, но в конфигурации Ehcache возникла проблема. Ниже приведено исключение:Spring4 Ehcache
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'com.googlecode.ehcache.annotations.impl.CacheAttributeSourceImpl#0':
Initialization of bean failed; 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'; 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:547)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
... 49 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'; 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:476)
at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:512)
at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:506)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1523)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1482)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
... 55 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:287)
at
org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:461)
Вы определили интерфейс для компонента? –
Да, я определил – xufeng
<боб ID = класс "cacheManager" = "org.springframework.cache.ehcache.EhCacheCacheManager" р: кэш-менеджер-исх = "EHCache" /> \t <- Ehcache установка библиотеки! -> \t –
xufeng