java - error-starting-applicationcontext-to-display-the-auto-configuration-report
问题描述
我正在尝试使用简单的弹簧启动应用程序。我在 ApplicationContext 上启动应用程序时遇到问题。
我使用 Eclipse Photon JDK8 Maven 4.0 Spring 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);
}
}
前文件.java
解决方案
错误是: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]
推荐阅读
- python - 在 Python 中创建关于特定人的爱好的字典名称:[hobby_1, hobby_2]
- caching - PageSpeed Insights 错误地报告缓存策略?
- c# - REGEX 非连续匹配字符串
- sql-server - 访问列表框第二项不显示
- django - django 中的“instance=”和“queryset=”是什么?
- reactjs - 让一个方法调用函数组件中的另一个方法
- amazon-web-services - 如何在存储在 AWS S3 存储桶中的文件夹上使用 torchvision.datasets.ImageFolder
- javascript - 如何使用没有 ID 的 JavaScript 更改类?
- java - 为什么我的 IF-ELSE-IF 语句不能正常工作?
- php - 使用用户信息生成 jwt