Springboot1.5.8.RELEASE 升级到 Springboot2.2.1.RELEASE 问题纪要
-
包名变更
import org.springframework.boot.web.support.SpringBootServletInitializer; 变更为 import org.springframework.boot.web.`servlet`.support.SpringBootServletInitializer; import org.springframework.boot.ApplicationHome; 变更为 import org.springframework.boot.`system`.ApplicationHome; -
jar包被移除
spring-boot-starter-logging中的log4j-over-slf4j被移除导致引用失败
import org.apache.log4j.Logger; private Logger logger = Logger.getLogger(getClass());解决:
import org.slf4j.Logger; import org.slf4j.LoggerFactory; private Logger logger = LoggerFactory.getLogger(this.getClass());
-
druid-spring-boot-starter版本过低。解决:由
2.1.4升级到最新版本2.1.21NoClassDefFoundError: org/springframework/boot/autoconfigure/jdbc/metadata/DataSourcePoolMetadataProvider -
循环依赖
Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sysUserService': Bean with name 'sysUserService' has been injected into other beans [sysRoleService] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.解决:1、避免循环依赖 2、使用@Lazy延迟加载bean
-
flyway配置添加了前缀
spring.flyway.enabled=true变更为spring.flyway.enabled=true