I\'m trying to run Spring Boot application connected to PostgreSQL database. However, when it comes to Hikari connection pool initializing, it just gets stuck and nothing go
try passing this parameter when you run your jar file:
-Djava.security.egd=file:/dev/../dev/urandom
In my case spring.datasource.hikari.initializationFailTimeout was set to a really high value, 3600000 (1 hour). This, in it self, was not a malconfiguration but it hid the real problem as the app was hanging on startup.
Once that value was adjusted, I got a much more understandable stack trace which led me to the conclusion that in this case I couldn't use the default MariaDB driver configuration that I probably got through a jHipster.
A very wierd problem that I so far only has seen with MySQL8 and Ubuntu 20 on AWS EC2. Locally I run Ubuntu and MySQL8 via Docker without issues.
Making below change in application.properties should work fine:
spring.datasource.url=jdbc:postgresql://localhost:5432/<dbName>
Also make sure, you have Fixed Port Number box unchecked, in the pgAdmin configuration BOX, refer the screenshot
Normal postgresql port is 5432, so I assume you also configured it to 55491.
Double check this via your postgresql client using psql -h 127.0.0.1 -p 55491 -d TodoAppDatabase -U admin
At last you can put the HikariCP into DEBUG mode, so you can see what parameters its using.
If your properties file is really apllication.properties than this may also an issue because spring boot only picks up application.properties automatically.
In my case it was a problem with a network connectivity. Make sure you can access your any configured servers if you got into this issue.
telnet host 5432
will let you connect to see if a route exists to the DB server.