运行我的java spring-boot项目时出现InvocationTargetException

时间:2019-06-11 12:19:38

标签: java postgresql hibernate spring-boot jpa

我正在尝试在我的本地主机上运行此项目:https://github.com/callicoder/spring-boot-postgresql-jpa-hibernate-rest-api-demo

我在本地系统中克隆了该项目。更改了我的application.properties文件中的必填字段。 mvn依赖项:树运行正常。 mvn spring-boot:run 引发错误。

错误是: Error

我的 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

让我知道运行此代码还需要什么。

我的 javac版本是:12.0.1

我的 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)

1 个答案:

答案 0 :(得分:0)

似乎在类路径中没有JAXB。尝试添加:

with dates as (
      select effdate as dte, enddate
      from t
      union all
      select dateadd(day, 1, dte), enddate
      from dates
      where dte < enddate
     )
select dte
from dates
option (maxrecursion 0);

这是Hibernate 5.4.x所需的版本。