springboot报错整理

1.The server time zone value is unrecognized or represents more than one time zone

服务器的时区的识别或代表多个时区。您必须配置服务器或JDBC驱动程序(通过serverTimezone配置属性)使用一个更具体的时区值如果你想利用时区支持。

在通过在数据库连接URL后,加上?serverTimezone=UTC

为什么是UTC

环境需要:如要维护多国环境如中美,时区一致便与维护

避免风险:避免PDT时区换算出错

2.service层添加Mapper接口报错(此错误不影响运行)

解决方法:在interface接口添加@Service注解;

3.java.lang.IllegalStateException: Optional int parameter 'id' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.

解决方法:

1.如果参数为一个基本类型,则将参数的类型改为对应的包装类型

2.如果参数时一组数据,则在方法的参数前添加@RequestBody

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章