[英]InvocationTargetException on running my java spring-boot project
I am trying to run this project on my localhost: https://github.com/callicoder/spring-boot-postgresql-jpa-hibernate-rest-api-demo 我试图在我的localhost上运行这个项目: https : //github.com/callicoder/spring-boot-postgresql-jpa-hibernate-rest-api-demo
I cloned the project in my local system. 我在我的本地系统中克隆了该项目。 Changed the required fields in my application.properties file.
更改了我的application.properties文件中的必填字段。 The mvn dependency:tree runs fine.
mvn依赖:树运行正常。 mvn spring-boot:run throws an error.
mvn spring-boot:run抛出错误。
My application.properties is: 我的application.properties是:
## Spring DATASOURCE
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres_demo
spring.datasource.username=postgres
spring.datasource.password=postgres
# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto = update
Let me know what else is required to get this code running. 让我知道运行此代码还需要什么。
My javac version is: 12.0.1 我的javac版本是:12.0.1
My java version says: 我的java版本说:
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
It seems that there is no JAXB in the classpath. 似乎类路径中没有JAXB。 Try adding:
尝试添加:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
This is the version that is needed by Hibernate version 5.4.x. 这是Hibernate版本5.4.x所需的版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.