org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappi
Posted 挑战者V
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappi相关的知识,希望对你有一定的参考价值。
错误产生背景:
将之前用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
以上是关于org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappi的主要内容,如果未能解决你的问题,请参考以下文章
REST API:org.springframework.beans.factory.UnsatisfiedDependencyException:
Spring security-org.springframework.beans.factory.BeanCreationException:创建名为“org.springframework.sec
org.springframework.beans.factory.UnsatisfiedDependencyException:
没有实现 [org.springframework.beans.factory.xml.NamespaceHandler] 接口
Spring Boot 错误 org.springframework.beans.factory.UnsatisfiedDependencyException
org.springframework.beans.factory.UnsatisfiedDependencyException:创建 bean 时出错