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
    

    解决方法

    • 加入如下注解
  • 相关阅读:
    NetCore去注册Eureka
    netcore项目使用swagger开发
    二、Rabbit使用-初次测试
    一、Rabbit使用-安装教程
    安装Erlang使用RabbitMQ
    Mac根目录下挂载文件
    将博客搬至CSDN
    photoshop for mac
    ssh 端口转发
    Linux 全局使用php命令
  • 原文地址:https://www.cnblogs.com/jachinlin/p/13530671.html
Copyright © 2011-2022 走看看