SpringBoot启动报错" Unable to start embedded container; nested exception is

时间:2025-02-16 07:14:12

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  - Application startup failed
: Unable to start embedded container; nested exception is 
:
Error creating bean with name '$EmbeddedTomcat': Initialization of bean failed; nested exception is : 
Error creating bean with name '': Initialization of bean failed; nested exception is : 
Error creating bean with name '' defined in class path resource [org/springframework/cache/annotation/ProxyCachingConfiguration.class]: 
Bean instantiation via factory method failed; nested exception is : Failed to instantiate 

关键词:

  • Unable to start embedded container;
  • Error creating bean with name
  • $EmbeddedTomcat’:
    Cache
    解决:
    所以猜测是注解配置的错误,报Bean工厂错误,后面找博客和相关其他排查了一下.发现是我注解@EnableCaching 在没有用到缓存技术就放到application启动类中了.@EnableCacheing要和@Cacheable(“books”)一起使用,否则就删了它,否则就会报这个错误

所以但凡是报该异常的,先排除一下是不是注解字段放错位置和拼写错误