I've been developing a simple app that uses geoserver inside tomcat, I was intending to register data to PostGis using java code and retrieve on Openlayers using geoserver. My webapp use a Postgres (https://jdbc.postgresql.org/download.html) and the PostGis (https://github.com/postgis/postgis-java/tree/master/jdbc) driver (both in tomcat lib directory), but Geoserver wasn't working properly, after looking in internet I found this:https://stackoverflow.com/questions/6981564/why-must-the-jdbc-driver-be-put-in-tomcat-home-lib-folder.

I suspect there is some jar conflict between the tomcat and geoserver probably with the PostGis driver and maybe geotools jar. With this conflict I'm not able to create DataStores in geoserver with my PostGis database. If I remove the PostGis jar from tomcat lib directory, GeoServer works correctly. I'd like to know if the problem is with Postgis driver, and if is possible to use them together somehow in the same tomcat instance.

[UPDATE] I'm using Tomcat 7.0, geoserver WAR version 2.10. Postgresql jdbc driver v9.4.1211 (the same in geoserver to avoid conflicts) and PostGis jdbc driver 2.2.2, I followed as explained in github repository Readme.md: "You can use the org.postgis. DriverWrapper as replacement for the jdbc driver. This class wraps the PostGreSQL Driver to transparently add the PostGIS Object Classes.".

When I try to create a new DataStore inside geoserver to my PostGis database a red message shows up just over the button "Save"

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 ...)

Inside eclipse, the error log is like this:

[data.store] - Error obtaining new data store java.io.IOException at org.geoserver.catalog.ResourcePool.getDataStore(ResourcePool.java:676) at org.geoserver.catalog.impl.DataStoreInfoImpl.getDataStore(DataStoreInfoImpl.java:38) at org.geoserver.web.data.store.DataAccessNewPage.onSaveDataStore(DataAccessNewPage.java:95) at org.geoserver.web.data.store.AbstractDataAccessPage$1.onSubmit(AbstractDataAccessPage.java:165) at org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.onSubmit(AjaxSubmitLink.java:110) at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$AjaxFormSubmitter.onSubmit(AjaxFormSubmitBehavior.java:215) at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1307) at org.apache.wicket.markup.html.form.Form.process(Form.java:974)

I'd like to post printscreens for the errors but I'm not able because of my reputation. [ENDUPDATE]

  • 2
    Unless I've missed what you are trying to do, it works out of the box for most people. Perhaps if you can provide some details (starting with version info) and log results, and ask a question (take the Tour if you haven't already) - something with a question mark at the end. Say what you've already tried, what you expected to happen, and what happened instead, and we should be able to help. – BradHards Feb 1 '17 at 2:04
  • @BradHards thanks a lot for your comment, I have updated the question description. Thanks! – Eduardo Dorneles Feb 3 '17 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.