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.

spring

緣由:hibernate和jpa的jar包衝突了

解決方案:把repository\org\hibernate的版本號刪除以後,再updata project,從新編譯運行便可

相關文章
相關標籤/搜索