springboot整合springdatajpa時jar沖突


1.springboot整合springdatajpa測試時報No bean named 'entityManagerFactory' available錯誤

2.運行springboot主程序時報以下錯誤

***************************
APPLICATION FAILED TO START
***************************
Description:
Field userRepository in com.sweng.giflib.service.UserServiceImpl required a bean named 'entityManagerFactory' that could not be found.
Action:
Consider defining a bean named 'entityManagerFactory' in your configuration.

原因:hibernate和jpa的jar包沖突了

解決方案:把repository\org\hibernate的版本號刪除之后,再updata project,重新編譯運行即可


免責聲明!

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



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