報錯 Inferred type 'S' for type parameter 'S' is not within its bound; 解決辦法


出現情況:

Inferred type 'S' for type parameter 'S' is not within its bound;

should extends xxxxxx

出現這種問題的原因:

  SpringBoot 版本問題,SpringBoot 2.0后新特性。

解決方法:

  1、修改版本,降為SpringBoot 1.5.x;

  2、修改代碼:

修改前:  return this.userRepository.findOne(id);
修改后:  return this.userRepository.findById(id).orElse(null);
 
         
         
       


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM