美文网首页
spring jpa RepositoryRestResourc

spring jpa RepositoryRestResourc

作者: Bigglesworth | 来源:发表于2019-10-22 10:26 被阅读0次

    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注解。

    相关文章

      网友评论

          本文标题:spring jpa RepositoryRestResourc

          本文链接:https://www.haomeiwen.com/subject/vwofvctx.html