Springboot JPA 启动报错
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
'repositorySchemaController' defined in URL Unsatisfied dependency expressed through constructor
parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'jsonSchemaConverter' defined in class path resource
[org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]: Bean
instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate
[org.springframework.data.rest.webmvc.json.PersistentEntityToJsonSchemaConverter]: Factory method
'jsonSchemaConverter' threw exception; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'associationLinks' defined in class path resource
[org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.springframework.data.rest.webmvc.mapping.Associations]: Factory method 'associationLinks' threw
exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'resourceMappings' defined in class path resource
[org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.springframework.data.rest.core.mapping.RepositoryResourceMappings]: Factory method
'resourceMappings' threw exception; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositories'
defined in class path resource
[org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]: Bean
instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.springframework.data.repository.support.Repositories]: Factory method 'repositories' threw exception;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with
name 'personRepository': Invocation of init method failed; nested exception is
java.lang.IllegalArgumentException: Not a managed type: class com.example.demo2.Entity.Person
错误原因是Entity实体类没有加上@Entity注解。
网友评论