I am trying to use JDBC to connect to Postgresql database.the error happens while trying to make a database connection.
conn = DriverManager.getConnection(url, user, password);
I deploy war file into wildfly that is docker container.
when I call the connect() method the error occur.
this is my pom.xml:
and while the wildfly is lunching there is always this warning that I guess is relevant to the connection refused Error:
Could not index class org/postgresql/jdbc/PgConnection$1.class at
java.lang.IllegalStateException: Required class information is missing
Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. 22:51:20,921 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /corsan/: java.lang.NullPointerException
when I deploy the war directly to the same application server in local it works fine. But when I use docker container this issue occure. I really appreciate for any hint or help because I really stuck in this part.
Source: Docker Questions