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

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