我的新书:《亿级流量网站架构核心技术》
Spring核心部分及其他
Spring缓存框架增强
异步调用和事件机制的异常处理
数据库集成测试脚本初始化
Spring MVC增强
页面自动化测试框架Spring MVC Test HtmlUnit简介
静态资源处理增强
Spring4.1新特性
Spring核心部分及其他
Spring缓存框架增强
异步调用和事件机制的异常处理
数据库集成测试脚本初始化
Spring MVC增强
页面自动化测试框架Spring MVC Test HtmlUnit简介
静态资源处理增强
如题
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.