Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache test failed? #1

Open
zorrogit opened this issue Dec 16, 2014 · 0 comments
Open

Cache test failed? #1

zorrogit opened this issue Dec 16, 2014 · 0 comments

Comments

@zorrogit
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant