Not able to connect to PostgreSQL DB

My application server is on Linux and PostgreSQL we are using native service cloudsql.
When i try to configure PostgreSQL DB connection in domain.xml from payara admin able to ping connection is fine but when i try to launch my application i see no info pls can any one advice.
image
log file i see below info
[2024-09-09T12:01:28.660+0000] [Payara 5.2022.2] [INFO] [org.glassfish.osgijavaeebase] [tid: _ThreadID=129 _ThreadName=pool-26-thread-1] [timeMillis: 1725883288660] [levelValue: 800] deployed bundle eu.echa.iuclid6.idp-ws [568] at file:/data/iuclid6-server-8.0.4/payara5/glassfish/domains/domain1/osgi-cache/felix/bundle407/data/applications/bundle568-1725880590866/

[2024-09-09T12:08:59.046+0000] [Payara 5.2022.2] [WARNING] [javax.enterprise.web] [tid: _ThreadID=243 _ThreadName=http-thread-pool::http-listener-2(7)] [timeMillis: 1725883739046] [levelValue: 900] [[
StandardWrapperValve[default]: Servlet.service() for servlet default threw exception
java.io.IOException: Connection is closed

Welcome, mahesh!

If ping-connection-pool is successful, then Payara can access the database (e.g. there is some SELECT successfully returned).

Your issue is in the code – can you send the piece of code, which makes problems? Is it called from Servlet or from EJB or CDI? How did you access the database – @PersistenceContext+EntityManager? How your persistence.xml looks like?

I suggest to have some β€œping” REST endpoint, which tests such basic functionality, eventually whole MicroProfile health.

And, of course, I suggest to upgrade to Payara 6, which is supported.

Regards,
Petr

Thanks Petr
I update latest postgresq.jar file and able to connect application.

Thanks for your reply

1 Like