cloudcaptainsh / cloudcaptain

Issue Tracker for CloudCaptain
13 stars 3 forks source link

Failure to parse application-prod.yml in JHipster 6.10 fat jar #244

Open sigi77777 opened 3 years ago

sigi77777 commented 3 years ago

Hello,

Currently if i run my Jhipster app on virtualbox i get: PSQLException: The hostname 10.0.2.2 could not be verified by hostnameverifier PgjdbcHostnameVerifier. (it works good on normal springboot startup ofc)

Running on AWS: PSQLException: Could not open SSL root certificate file //.postgresql/root.crt.

Question is: Am i missing something, or the jdbc url should be manipulated in a different way by boxfuse. Seems like boxfuse ignores the get parameters like: sslmode=verify-ca inside it. Locally on virtualbox: postgresql://10.0.2.2:5433/boxfuse-dev-db?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory

On AWS deploy: -DSPRING_DATASOURCE_URL=jdbc:postgresql://xxxx-xxxx-xxxx-xxxx:5432/xxx_xxx?ssl=true' no matter if i change something in my application-prod.yml

axelfontaine commented 3 years ago

Can you try downgrading your driver as described in #234 and let me know if it helped?

sigi77777 commented 3 years ago

yes, downgraded the driver. thanks! now it starts but in virtualm machine mode the postgresql is too old, version 9. doesnt understand liquibase sql init statments (IF NOT EXISTS). and in aws prod mode, i get :org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfiguration' defined in URL ..... BeanCreationException: Error creating bean with name 'persistentTokenRememberMeServices' defined in URL ....security/PersistentTokenRememberMeServices.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [......security.PersistentTokenRememberMeServices]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: key cannot be empty or null

Does boxfuse work with latest stable release of jhipster with postgresql? Am i missing something?

axelfontaine commented 3 years ago

What is the root exception you are seeing in that stacktrace in your prod environment?

sigi77777 commented 3 years ago

Ok, the problem was that fusebox doesnt parse application-prod.yml if it is packaged in jar mode. Jhipsters boxfuse documentation page has a mistake, should be updated with the following command: ./gradlew -Pprod -Pwar clean bootWar

if war is generated, the yml is parsed, and the securityconfig is built.

Now everything looks and works fine. thanks!

axelfontaine commented 3 years ago

Thanks for the thumbs up. I've updated the issue title to reflect this. Which version of JHipster are you using exactly?

sigi77777 commented 3 years ago

6.10.5 One more thing: t3.nano is not enough for jhipster+boxfuse. micro is seems the minimum. Works for me with xmx900m