美文网首页
2019-11-15 Springboot1.5.8.RELEA

2019-11-15 Springboot1.5.8.RELEA

作者: 杨浩0712 | 来源:发表于2019-11-15 10:11 被阅读0次

    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.21

      NoClassDefFoundError: 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

    相关文章

      网友评论

          本文标题:2019-11-15 Springboot1.5.8.RELEA

          本文链接:https://www.haomeiwen.com/subject/smyjictx.html