zoukankan      html  css  js  c++  java
  • Spring Boot 报错:Error creating bean with name 'entityManagerFactory' defined in class path resource

    spring boot 写一个web项目,在使用spring-data-jpa的时候,启动报如下错误:

    Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
    2018-04-02 17:00:47.076 ERROR 4648 --- [ main] o.s.boot.SpringApplication : Application startup failed

    解决方式:加入依赖既可

        <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-entitymanager</artifactId>
          <version>5.0.3.Final</version>
        </dependency>

    另外,有看到资料说,在mainApplication中,加如下注解也可以解决:

      @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})

    启动的确不报错了,但是此时,自动创建表功能并未实现,建议用第一种方式。

  • 相关阅读:
    常见字体图标库——font-awesome
    windows server 2012显示桌面图标
    SE 2014年4月14日
    SE 2014年4月13日
    PPP协议总结
    SE 2014年4月12日
    django运行时报错
    linux-python在vim下的自动补全功能
    python发邮件
    背景透明兼容
  • 原文地址:https://www.cnblogs.com/hiyu/p/8695431.html
Copyright © 2011-2022 走看看