【问题标题】:error-starting-applicationcontext-to-display-the-auto-configuration-reporterror-starting-applicationcontext-to-display-the-auto-configuration-report
【发布时间】:2019-03-18 22:59:22
【问题描述】:

我正在尝试使用简单的 Spring Boot 应用程序。我在 ApplicationContext 上启动应用程序时遇到问题。

我使用 Eclipse Photon JDK8 Maven 4.0 春天 1.5.16

Pom.xml

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>org.fam</groupId>
<artifactId>Prifile</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Prifile</name>
<description>Demo project for Spring Boot</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.16.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

PrefileApplication.java

包org.famy;

导入 org.springframework.boot.SpringApplication; 导入 org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication 公共类 PrifileApplication {

public static void main(String[] args) {
    SpringApplication.run(PrifileApplication.class, args);
}

}

Prefile.java

【问题讨论】:

标签: java spring maven spring-boot


【解决方案1】:

错误是: org.springframework.beans.factory.BeanCreationException:在类路径资源[org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]中定义名称为“entityManagerFactory”的bean创建错误:调用init方法失败;嵌套异常是 org.hibernate.service.spi.ServiceException:无法创建请求的服务 [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

【讨论】:

    猜你喜欢
    • 2022-12-02
    • 1970-01-01
    • 1970-01-01
    • 2022-11-20
    • 1970-01-01
    • 2022-12-27
    • 2021-10-06
    • 2021-12-09
    • 1970-01-01
    相关资源
    最近更新 更多