springboot升级

安全原因,springboot 从2.0.9 升级到 2.2.10,有点坑:

1.JpaRepositoryFactory 接口有变化getTargetRepository 改为final不能被复写,改为使用另一带EntityManager参数的方法即可

2.启动应用报错

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:175)

 

2.2.10 调用了tomcat的disableRegistry方法,之前的tomcat用的8.5没这个方法,看来还得升级tomcat,索性升级到tomcat9.0.38最新版

升级tomcat后又报错:

 

 

 再修改jdbc 链接串:

加上:&serverTimezone\=GMT%2B8 ,注:此处有UTC、GMT等参数,GMT是前世界标准时,UTC是现世界标准时,区别不大,中国时区用GMT+8即可,应当与数据库保持一致,否则有时差。

可以看一下mysql时区,一般都用的系统时区:show variables like '%time_zone%';

 

加上后启动成功,测试接口正常

 

posted on 2020-10-09 10:13  webjlwang  阅读(469)  评论(0编辑  收藏  举报

导航