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
Best Answer
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.