Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hapi.properties is gone #135

Closed
JoeMcCaffrey opened this issue Sep 17, 2020 · 27 comments
Closed

hapi.properties is gone #135

JoeMcCaffrey opened this issue Sep 17, 2020 · 27 comments

Comments

@JoeMcCaffrey
Copy link

title

@jamesagnew
Copy link
Contributor

The hapi.properties has been replaced with application.yaml, per this PR:

#125

I do notice that the project README still refers to the hapi.properties file - @jvitrifork would you be able to update?

@jvitrifork
Copy link
Collaborator

sure - I'll have a look tomorrow

@JoeMcCaffrey
Copy link
Author

I've updated my application.yaml with the postgres credentials, driver and dialect and it seems to be missing tables on start-up. Is postgres still supported?

@JoeMcCaffrey
Copy link
Author

Caused by: org.springframework.batch.core.JobParametersInvalidException: There must be a valid number for readChunkSize, which is at least 1. You must include [resourceTypes] as a Job Parameter

and

Caused by: org.postgresql.util.PSQLException: ERROR: relation "hfj_search" does not exist

@jvitrifork
Copy link
Collaborator

what are you deploying and how?

@jvitrifork
Copy link
Collaborator

how did you build it?

@JoeMcCaffrey
Copy link
Author

mvn clean install -DskipTests just running it locally.

Joe-McCaffrey’s-MacBook-Pro:hapi-fhir-jpaserver-starter jmccaffrey$ java -version
openjdk version "12.0.2" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 12.0.2+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 12.0.2+10, mixed mode)

@jvitrifork
Copy link
Collaborator

and how do you deploy it? There are from now on a couple of ways how to run/deploy it. I'll get to it tomorrow. If you have docker installed, may I suggest you try out the following:

mvn clean package com.google.cloud.tools:jib-maven-plugin:dockerBuild -Dimage=distroless-hapi && docker run -p 8080:8080 -e spring.batch.job.enabled=false distroless-hapi

@JoeMcCaffrey
Copy link
Author

I'll use k8s but I'm just doing a proof of concept at the moment

@jvitrifork
Copy link
Collaborator

I mean - do you deploy it into a running app server (eg. tomcat) or are you running it as spring boot application?

@JoeMcCaffrey
Copy link
Author

mvn jetty:run is what I'm using (from the docs)

@jvitrifork
Copy link
Collaborator

mvn clean package jetty:run -Dspring.batch.job.enabled=false will get you running. I'll update the doc later today

@ZuSe
Copy link

ZuSe commented Sep 18, 2020

Hi @jvitrifork

i am observing the same problem like @JoeMcCaffrey . It does not startup with jetty.
I guess its because of using the wrong dialect. Check below.

My application file: https://paste.ubuntu.com/p/NjDDWkJ72V/
My startup log: https://paste.ubuntu.com/p/dvgsYcNs2K/

Problem might come from here:
2020-09-18 11:15:01.265 [main] INFO org.hibernate.dialect.Dialect [Dialect.java:172] HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2020-09-18 11:15:01.380 [main] ERROR o.h.e.j.e.i.JdbcEnvironmentImpl [JdbcEnvironmentImpl.java:420] Could not fetch the SequenceInformation from the database

Even it is set to PSQL in the hibernate section of my config file.

@jvitrifork
Copy link
Collaborator

@ZuSe thx - that gives me something to work with.

@jvitrifork
Copy link
Collaborator

@ZuSe until the doc gets updated- you can use eg.

mvn clean package com.google.cloud.tools:jib-maven-plugin:dockerBuild -Dimage=distroless-hapi && docker run -p 8080:8080 -e spring.batch.job.enabled=false distroless-hapi

-That should get you rolling with your settings

@jvitrifork
Copy link
Collaborator

let me know how that works out for you

@ZuSe
Copy link

ZuSe commented Sep 18, 2020

@jvitrifork Same issue. Still the wrong dialect:

2020-09-18 14:16:40.286 [main] INFO org.hibernate.Version [Version.java:44] HHH000412: Hibernate ORM core version 5.4.14.Final
2020-09-18 14:16:40.400 [main] INFO o.h.annotations.common.Version [JavaReflectionManager.java:49] HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2020-09-18 14:16:40.651 [main] INFO com.zaxxer.hikari.HikariDataSource [HikariDataSource.java:95] HikariPool-1 - Starting...
2020-09-18 14:16:42.578 [main] INFO com.zaxxer.hikari.HikariDataSource [HikariDataSource.java:107] HikariPool-1 - Start completed.
2020-09-18 14:16:42.601 [main] INFO org.hibernate.dialect.Dialect [Dialect.java:172] HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2020-09-18 14:16:48.992 [main] ERROR o.h.e.j.e.i.JdbcEnvironmentImpl [JdbcEnvironmentImpl.java:420] Could not fetch the SequenceInformation from the database
org.postgresql.util.PSQLException: The column name min_value was not found in this ResultSet.
at org.postgresql.jdbc.PgResultSet.findColumn(PgResultSet.java:2607)
at org.postgresql.jdbc.PgResultSet.getLong(PgResultSet.java:2502)
at org.hibernate.tool.schema.extract.internal.SequenceInformationExtractor

@JoeMcCaffrey
Copy link
Author

I have the same error ^

@jvitrifork
Copy link
Collaborator

please try mvn clean package spring-boot:repackage -Pboot && java -jar target/hapi-fhir-jpaserver.war

@JoeMcCaffrey
Copy link
Author

No dice, same thing

@JoeMcCaffrey
Copy link
Author

okay mvn clean package jetty:run -Dspring.batch.job.enabled=false is working with changing properties.put("hibernate.dialect", "org.hibernate.dialect.PostgreSQL95Dialect"); in EnvironmentHelper.java

H2 was hard coded when spring.jpa.properties == null

@jvitrifork
Copy link
Collaborator

thats a bug. I'm gonna have a look at it later today

@jvitrifork
Copy link
Collaborator

#138 addresses the issue

@JoeMcCaffrey
Copy link
Author

@jvitrifork thanks! master is working for me with mvn clean package jetty:run -Dspring.batch.job.enabled=false connected to postgres

@jvitrifork
Copy link
Collaborator

@JoeMcCaffrey please close this if you are satisfied with the current solution

@j-fbriere
Copy link

j-fbriere commented Sep 24, 2020

Before closing this important issue, @jvitrifork, could you please explain how to override the configuration file?
Before there was the hapi.properties System property that specified the path of an alternate hapi.properties file.
How is it done now to specify an alternate application.yaml file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants