I can not find where the error is generated although the logs are clear... Caused by: java.net.UnknownHostException: votaideasdb. So I understand who did it, but can not see what is the problem or how to solve it. (It works in my local server).
As I look for it I saw it had to do with...
- Either put a PostgreSql binary jar to tomcat lib folder I have done it .
- Other connection problems such as:
- The PostgreSQL server being restarted (DONE)
- The PostgreSQL backend you were connected to being terminated (Can Navicat be connected and the connection terminated at the same time?)
- The PostgreSQL backend you were connected to crashing (Can Navicat be connected and the connection terminated at the same time?)
- Dodgy network connection (Can Navicat be connected and the connection terminated at the same time?)
- Badly behaved stateful firewalls (Can Navicat be connected and the connection terminated at the same time?)
- Idle connections timing out of the NAT connection tables of NAT firewall/routers (Can Navicat be connected and the connection terminated at the same time?)
If Navicat is connecting with the same user and password, does it probe that the connection is working? It may have to do with the connection pool, but I do not see how or how to test it.
2018-01-11 13:31:16.407 ERROR 3629 --- [p-nio-80-exec-8] o.a.tomcat.jdbc.pool.ConnectionPool : Unable to create initial connections of pool.
org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:262) ~[postgresql-9.4.1208.jre7.jar:9.4.1208.jre7]
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66) ~[postgresql-9.4.1208.jre7.jar:9.4.1208.jre7]
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:215) ~[postgresql-9.4.1208.jre7.jar:9.4.1208.jre7]
Caused by: java.net.UnknownHostException: votaideasdb
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) ~[na:1.8.0_151]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_151]
at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_151]
at org.postgresql.core.PGStream.<init>(PGStream.java:64) ~[postgresql-9.4.1208.jre7.jar:9.4.1208.jre7]
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:133) ~[postgresql-9.4.1208.jre7.jar:9.4.1208.jre7]
... 159 common frames omitted
I do not know where that voteideasdb name (Caused by: java.net.UnknownHostException: votaideasdb) comes from is the database name is springboottutorial.
These are my application.properties (that work fine in my local server)
spring.datasource.url=jdbc:postgresql://localhost:5432/springboottutorial
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.datasource.driverClassName=org.postgresql.Driver
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.generate-ddl=true
hibernate.postgresql.auto=create
spring.jpa.show-sql=true
Thank you all for you patience with non-programmers!!!!