zoukankan      html  css  js  c++  java
  • springboot 使用jpa时遇到bug

    问题1如下

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productCategoryRepository' defined in com.wechat.selectfood.dao.ProductCategoryRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Cannot resolve reference to bean 'jpaMappingContext' while setting bean property 'mappingContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappingContext': Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
    
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappingContext': Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
    

    解决方案

    • 启动类上加上如下注解

    问题二

    by: org.hibernate.AnnotationException: No identifier specified for entity: com.itmumu.Entity.User
    

    解决方法

    • 加入如下注解
  • 相关阅读:
    魔兽争霸3 视野插件
    使用MS08-067 漏洞攻击xp靶机
    CentOS 7 安装Nginx
    给linux系统添加系统调用
    树莓派3b aarch64 cpu性能测试
    树莓派3b 安装arch linux 2
    树莓派3b 安装arch linux 1
    远程线程注入 CreateRemoteThread 返回NULL
    go mod 相关
    给 Windows 的终端配置代理
  • 原文地址:https://www.cnblogs.com/jachinlin/p/13530671.html
Copyright © 2011-2022 走看看