TransWikia.com

Geoserver & PostGIS: Cannot create PoolableConnectionFactory

Geographic Information Systems Asked on September 26, 2021

I am trying to add a PostGIS database a data store in my Geoserver installation but I keep getting this error:

Error creating data store, check the parameters. Error message: Unable to obtain connection: Cannot create PoolableConnectionFactory (Something unusual has occurred to cause the driver to fail. Please report this exception.)

I am thinking that maybe I need to add an entry to my pg_hba.conf file, but it seems that adding anything to it causes the postgres server to not be able to start back up again.

Has anyone had this issue before? Was it solvable by addeding an entry to pg_hba.conf?

Since my geoserver resides on http://localhost:8080/ I tried adding:

host all all 127.0.0.1/8080

to pg_hba.conf but trying to restart the server just results in postgres crashing until I remove it again.

This is what the contents of my pg_hba.conf look like:

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5

Here are the geoserver log outputs after I try to make the data store:

catalina.out: https://pastebin.com/aBuJchYP

catalina.2018.06-16.log: https://pastebin.com/MuXhkcA9

localhost_access_log.2018-06-16.txt: https://pastebin.com/qh61BmAs

Other info:

  • geoserver version: 2.13
  • Postgres version: 9.6.9
  • PosGIS version: 2.4

4 Answers

I was finally able to solve this issue (although quickly ran into more).

It seems that the postgis .jar file was not included in the .war file that created the geoserver folder. I'm not sure if it is an oversight on the part of the geoserver team or if it is being caused by some strangeness on my end.

I downloaded postgis-jdbc-2.1.7.jar from http://postgis.net/stuff/ and put it in my /var/lib/tomcat8/webapps/geoserver/WEB_INF/lib folder and then I was able to publish data stores.

Correct answer by wfgeo on September 26, 2021

Here's what a working pg_hba.conf file should look like:

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5
host     all             all             0.0.0.0/0               md5

Answered by Rudy Stricklan on September 26, 2021

I had the very same problem until i disovered I was using 'localhost' as a host reference. Since I am running GeoServer on a Physical Server machine on the network with with physical clients; by entering the server Server's Computer Name or IP address the issue was resolved went through.

Answered by McTrevors on September 26, 2021

navigate to "C:Program FilesPostgreSQL13datapg_hba.conf" and change Method of "local" as "true" enter image description here

Answered by umit90 on September 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP