You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a great example to show how caching works in spring 4.1
However I am trying to run the unit test in it but failed, I wonder if you could help to take a look?
$ git clone ....
$ cd spring4.1-cache/
$ mvn test
WARNING: Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appConfig': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.annotation.ProxyCachingConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.Collection org.springframework.cache.annotation.AbstractCachingConfiguration.cacheManagerBeans; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManager' defined in class com.sishuok.spring.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.cache.CacheManager com.sishuok.spring.AppConfig.cacheManager()] threw exception; nested exception is javax.cache.CacheException: A cache named user already exists.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:548)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
....
....
Results :
Tests in error:
testCache(com.sishuok.spring.service.UserService2Test): Failed to load ApplicationContext
testCache(com.sishuok.spring.service.UserServiceTest): Failed to load ApplicationContext
Tests run: 3, Failures: 0, Errors: 2, Skipped: 0
The text was updated successfully, but these errors were encountered:
Hi,
This is a great example to show how caching works in spring 4.1
However I am trying to run the unit test in it but failed, I wonder if you could help to take a look?
$ git clone ....
$ cd spring4.1-cache/
$ mvn test
WARNING: Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appConfig': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.annotation.ProxyCachingConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.Collection org.springframework.cache.annotation.AbstractCachingConfiguration.cacheManagerBeans; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheManager' defined in class com.sishuok.spring.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.cache.CacheManager com.sishuok.spring.AppConfig.cacheManager()] threw exception; nested exception is javax.cache.CacheException: A cache named user already exists.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:548)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
....
....
Results :
Tests in error:
testCache(com.sishuok.spring.service.UserService2Test): Failed to load ApplicationContext
testCache(com.sishuok.spring.service.UserServiceTest): Failed to load ApplicationContext
Tests run: 3, Failures: 0, Errors: 2, Skipped: 0
The text was updated successfully, but these errors were encountered: