Discuss / Java / springboot内各组件版本和jdk版本有很高要求,版本不一致就会报各种奇奇怪怪的问题

springboot内各组件版本和jdk版本有很高要求,版本不一致就会报各种奇奇怪怪的问题

Topic source

Loading...

#1 Created at ... [Delete] [Delete and Lock User]

一开始我用idea新建了一个项目,2.7.8版本,然后其他依赖使用的和廖大的一样。启动直接报错,说什么bean的依赖关系形成了一个循环

The dependencies of some of the beans in the application context form a cycle:

   viewResolver defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]
      ↓
   com.mitchellbosecke.pebble.boot.autoconfigure.PebbleAutoConfiguration$PebbleWebMvcConfiguration (field private com.mitchellbosecke.pebble.PebbleEngine com.mitchellbosecke.pebble.boot.autoconfigure.PebbleAutoConfiguration$PebbleWebMvcConfiguration.pebbleEngine)
┌─────┐
|  com.mitchellbosecke.pebble.boot.autoconfigure.PebbleAutoConfiguration$PebbleDefaultConfiguration (field private java.util.List com.mitchellbosecke.pebble.boot.autoconfigure.PebbleAutoConfiguration$PebbleDefaultConfiguration.extensions)
└─────┘


Action:

Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.

怀疑是pebbetemplate版本和springboot版本不搭的问题,然后把springboot换成和廖大一样的版本2.3.0可以正常返回页面。以后这种报错全靠百度了,定位都定位不出来,不知道改哪里,,,

廖雪峰

#2 Created at ... [Delete] [Delete and Lock User]

看清楚喔,已经更新到spring boot 3了


  • 1

Reply