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]