SpringBoot升级全纪录之项目启动

SpringBoot升级全纪录之项目启动

  • [1、错误: java.nio.charset.MalformedInputException: Input length = 1](#1、错误: java.nio.charset.MalformedInputException: Input length = 1)
  • [2、java.lang.NoClassDefFoundError: ch/qos/logback/core/util/StatusPrinter2](#2、java.lang.NoClassDefFoundError: ch/qos/logback/core/util/StatusPrinter2)
  • [3、Logging system failed to initialize using configuration from 'null'](#3、Logging system failed to initialize using configuration from 'null')
  • [4、java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ser/std/ToStringSerializerBase](#4、java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ser/std/ToStringSerializerBase)
  • [5、Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required](#5、Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required)
  • 6、程序包com.baomidou.mybatisplus.generator不存在
  • [7、Invalid value type for attribute 'factoryBeanObjectType': java.lang.String](#7、Invalid value type for attribute 'factoryBeanObjectType': java.lang.String)
  • [8、Bean named 'redisTemplate' is expected to be of type 'org.springframework.data.redis.core.StringRedisTemplate' but was actually of type 'org.springframework.data.redis.core.RedisTemplate'](#8、Bean named ‘redisTemplate’ is expected to be of type ‘org.springframework.data.redis.core.StringRedisTemplate’ but was actually of type ‘org.springframework.data.redis.core.RedisTemplate’)
  • [9、No data sources are configured to run this SQL and provide advanced code assistance. Disable this inspection via problem menu (Alt+Enter).](#9、No data sources are configured to run this SQL and provide advanced code assistance. Disable this inspection via problem menu (Alt+Enter).)
  • [10、org.apache.catalina.core.StandardService stopInternal](#10、org.apache.catalina.core.StandardService stopInternal)
  • [11、Initialization Sequence datacenterId:16 workerId:17](#11、Initialization Sequence datacenterId:16 workerId:17)
  • [12、 Bean named 'ddlApplicationRunner' is expected to be of type 'org.springframework.boot.Runner' but was actually of type 'org.springframework.beans.factory.support.NullBean'](#12、 Bean named 'ddlApplicationRunner' is expected to be of type 'org.springframework.boot.Runner' but was actually of type 'org.springframework.beans.factory.support.NullBean')
  • [13、Access denied for user 'root'@'127.0.0.1' (using password: YES)](#13、Access denied for user ‘root‘@‘127.0.0.1‘ (using password: YES))
  • END

1、错误: java.nio.charset.MalformedInputException: Input length = 1

原因:项目编码问题

解决:https://blog.csdn.net/qq_38254635/article/details/141018793


2、java.lang.NoClassDefFoundError: ch/qos/logback/core/util/StatusPrinter2

原因:Maven包冲突

解决:https://blog.csdn.net/qq_38254635/article/details/141019735


3、Logging system failed to initialize using configuration from 'null'

原因:缺少 logback-spring.xml 配置文件

解决:https://blog.csdn.net/qq_38254635/article/details/141021782


4、java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/ser/std/ToStringSerializerBase

原因:Maven包版本有误,类不存在,升级至2.17.1

解决:https://blog.csdn.net/qq_38254635/article/details/141024403


5、Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

原因:升级mybatis-plus-boot-starter由2.3至3.5.3.2

解决:https://blog.csdn.net/qq_38254635/article/details/141159153


6、程序包com.baomidou.mybatisplus.generator不存在

原因:mybatis-plus-generator版本不兼容

解决:https://blog.csdn.net/qq_38254635/article/details/141166324


7、Invalid value type for attribute 'factoryBeanObjectType': java.lang.String

原因:mybatis-plus-generator版本不兼容

解决:https://blog.csdn.net/qq_38254635/article/details/141167883


8、Bean named 'redisTemplate' is expected to be of type 'org.springframework.data.redis.core.StringRedisTemplate' but was actually of type 'org.springframework.data.redis.core.RedisTemplate'

原因:bean未识别,注解需替换为 @Resource

解决:https://blog.csdn.net/qq_38254635/article/details/141725820


原因:需要配置Database

解决:https://blog.csdn.net/qq_38254635/article/details/141726108


10、org.apache.catalina.core.StandardService stopInternal

原因:由于Java EE已经变更为Jakarta EE,包名以javax开头的需要改为jakarta

解决:https://blog.csdn.net/qq_38254635/article/details/142137747


11、Initialization Sequence datacenterId:16 workerId:17

原因:启动类增加 @EnableAutoConfiguration

解决:https://blog.csdn.net/qq_38254635/article/details/143887970


12、 Bean named 'ddlApplicationRunner' is expected to be of type 'org.springframework.boot.Runner' but was actually of type 'org.springframework.beans.factory.support.NullBean'

原因:mybatis-plus-boot-starter版本与当前项目不兼容

解决:https://blog.csdn.net/qq_38254635/article/details/143888315


13、Access denied for user 'root'@'127.0.0.1' (using password: YES)

原因:Mysql的密码错了,修改一下密码即可。

解决:https://blog.csdn.net/qq_38254635/article/details/143888615


END

从目前的报错来看,直接从JAVA8往JAVA17/21去升级,一定是困难重重的,而且很多的组件都会出现不适配的情况。

所以,结合目前的情况,建议放弃直接改造。

而是使用JAVA17直接搭建一套空白脚手架,然后将业务代码分类填充,就会方便很多,而且会更快。

空白脚手架注意内容:拦截器,过滤器,事务控制,跨域,加解密,加签验签,权限,session控制,通用异常处理机制,数据库驱动,Mybatis组件,定时任务quartz,日志管理,redis组件,配置文件jasypt加密,RABC,工具类等等。


OK,就这些吧。

有什么不对的还望指正,书写不易,觉得有帮助就点个赞吧!☺☺☺

相关推荐
武昌库里写JAVA14 分钟前
大模型评估论文粗读“AGIEval: A Human-Centric Benchmark for Evaluating Foundation Models“
vue.js·spring boot·毕业设计·layui·课程设计
du fei27 分钟前
C# 组件的使用方法
java·开发语言·c#
追风落叶乔木生29 分钟前
Light RPC:一款轻量高效的Java RPC框架实践指南
java·spring boot·rpc
风象南32 分钟前
SpringBoot项目如何用ServiceLocatorFactoryBean优雅切换支付渠道?
java·spring boot·后端
java_强哥35 分钟前
SpringBoot集成阿里云文档格式转换实现pdf转换word,excel
spring boot·阿里云·pdf
CopyLower43 分钟前
深入剖析 Kafka 的零拷贝原理:从操作系统到 Java 实践
java·kafka·linq
烁3471 小时前
每日一题(小白)暴力娱乐篇29
java·数据结构·算法·娱乐
缺一句感谢和缺一句道歉1 小时前
阿里云kafka集成boot在docker启动找不到kafka.client.truststore.jks文件问题
java·spring boot·kafka
就是蠢啊1 小时前
Maven 基础知识
java·maven
珹洺2 小时前
Java-servlet(完结篇)过滤器乱码解决与监听器
java·运维·服务器·hive·servlet·jsp