org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappingContext之解決辦法


錯誤產生背景:
將之前用Eclipse寫的Blog項目遷移到Idea上面。Ecilpse項目一直是沒有問題的。

錯誤原因分析:
原因是項目依賴中引入的jpa,另外也與Idea比較智能也有關系

解決辦法:

第一,在啟動類中加上如下注解代碼

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,JpaRepositoriesAutoConfiguration.class,HibernateJpaAutoConfiguration.class})

第二,maven依賴中排除該依賴(盡管在pom.xml去除了,但是不要忘記maven有依賴傳遞的特性)

參考解決辦法鏈接(stackoverflow上面找到的解決方案):
https://stackoverflow.com/questions/40738818/illegalargumentexception-at-least-one-jpa-metamodel-must-be-present


免責聲明!

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



猜您在找 springMVC常見錯誤-解決org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.spring org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXX': mvn ssm 異常 org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'multipartResolver' org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bireportSqlSessionFactory' defined in URL 嚴重: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'familyDao' defined in file Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xtCsDao': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanC org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.facto org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Invocation of init method
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM