Let me check that out since my employer works with both applications.

Before you start: Please try setting up geoserver in a tomcat just on its
own, just to confirm it works as you expect. Prior to sharing tomcat with
the two applications.

Presently each application includes a postgresql driver, you will need to
make sure only one is used:

- Your geonetwork is using postgresql jar version 42.2.5 (
https://github.com/geonetwork/core-geonetwork/blob/4.0.4/pom.xml#L1499)
- The GeoServer postgresql jar version is indeed 42.2.19 (
https://github.com/geotools/geotools/blob/25.0/pom.xml#L115)

The general approach:
1. Remove the jdbc driver from the individual applications (both of them)
2. Add the jar to tomcat and a JNDI data source for each applicaiton
3. For details see:
https://tomcat.apache.org/tomcat-9.0-doc/jndi-datasource-examples-howto.html#PostgreSQL

--
Jody Garnett


On Sun, 23 May 2021 at 10:04, Mats Elfström <mats.elfst...@giskraft.se>
wrote:

> Dear list.
> I am struggling with a breaking and never before experienced Geoserver
> configuration error.
> The setup is Geoserver (2.18-2.20, all have the same problem) and
> Geonetwork 4.0.4 as webapps under Tomcat 9 on a Windows 2016 server. All
> being parts of a geodata service I am building.
>
> Geonetwork uses PostgreSQL 11.11/PostGis 3.0.3 on a JNDI connection. It
> has been running for about a month.
> Now I want to create Geoserver stores from the same PG instance, on
> another database which is loaded with geodata. I can connect to this
> database with QGIS and FME with no problem.
> However, Geoserver refuses to connect, and gives no helpful log hints.
>
> 1/ Standard  PostGIS - PostGIS Database setup fails, producing two pages
> of Java errors, Oops, something went wrong... and An error occurred while
> loading the page. The log file reports a geotools.jdbc error:
> 2021-05-23 18:40:55,252 ERROR [geotools.jdbc] - There's code using JDBC
> based datastore and not disposing them. This may lead to temporary loss of
> database connections. Please make sure all data access code calls
> DataStore.dispose() before freeing all references to it
> This may be due to the existing JNDI connection to Geonetwork, but that is
> using another database and another user account.
> 2/ As an alternative, and what I would prefer is to  set up another
> PostGIS (JNDI) - PostGIS Database (JNDI) connection for Geoserver.
> This fails due to false instructions. The manual instructs first to move
> the file postgresql-X.X-XXX.jdbc3.jar from the WEB-INF/lib folder and put
> it into the TOMCAT_HOME/lib folder.
> There is no such file in Geoserver 2.19. The closest is
> postgresql-42.2.19.jar, but moving that file breaks Geoserver which does
> not start because this file is missing. At the moment, this is a vanilla
> 2.19 Geoserver.
>
> Setting up PostGIS stores must be the most common connection of all, and I
> have been using that for years. But never with breaking errors like these.
>
> Regards, Mats.E
> --
>
>
> *GisKraft*, Geodatakonsult
>
> Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
> tel: +46 70 595 39 35 / www.giskraft.se
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to