SpringBoot启动报如下异常:
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-09-15 14:08:02.979 [restartedMain] ERROR org.springframework.boot.SpringApplication - Application startup failed
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.cache.config.internalCacheAdvisor' defined in class path resource [org/springframework/cache/annotation/ProxyCachingConfiguration.class]:
Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate
关键词:
- Unable to start embedded container;
- Error creating bean with name
- org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat’:
Cache
解决:
所以猜测是注解配置的错误,报Bean工厂错误,后面找博客和相关其他排查了一下.发现是我注解@EnableCaching 在没有用到缓存技术就放到application启动类中了.@EnableCacheing要和@Cacheable(“books”)一起使用,否则就删了它,否则就会报这个错误
所以但凡是报该异常的,先排除一下是不是注解字段放错位置和拼写错误