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