[GeoNetwork-users] PostGIS configuration in Geonetwork 3

Hi,

I'm trying to configure a new Geonetwork 3 installed as a war file to connect to postGIS

Before that I have a Geonetwork 2.10 running with this configuration perfect:

---
   <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
     <!-- postgresql -->
     <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
     <resource enabled="true">
       <name>main-db</name>
<provider>jeeves.resources.dbms.ApacheDBCPool</provider>
       <config>
         <user>geonetwork</user>
         <password>xxxxxx</password>
         <!-- we use org.postgis.DriverWrapper in place of
                 org.postgresql.Driver to support both postgresql and postgis -->
         <!--
         <driver>org.postgresql.Driver</driver>
                 -->
         <driver>org.postgis.DriverWrapper</driver>
         <!--
                     jdbc:postgresql:database
                     jdbc:postgresql://host/database
                     jdbc:postgresql://host:port/database

                     or if you are using postgis and want the spatial index loaded
                     into postgis

                     jdbc:postgresql_postGIS://host:port/database

                 -->
<url>jdbc:postgresql_postGIS://coobd:5432/gn</url>
         <poolSize>10</poolSize>
         <validationQuery>SELECT 1</validationQuery>
       </config>
     </resource>
---

I'm trying to edit config-node/srv.xml file to use config-db/postgresql.xml and config-db/jndi-postgres-postgis.xml
In first case I changed 2 lines:

        <!--<constructor-arg value="org.postgresql.Driver"/> -->
         <constructor-arg value="org.postgis.DriverWrapper"/>

         <!--<constructor-arg value="jdbc:postgresql://${jdbc.host}:5432/${jdbc.database}"/> -->
         <constructor-arg value="jdbc:postgresql_postGIS://${jdbc.(user, pass, host, dbhost}:5432/${jdbc.database}"/>

Then I update jdbc.properties (user, pass, host, db)

After that I create a clean PostGIS database with that parameters

Then reboot geonetwork but a lot of SEVERE errors related to datasource

Anybody knows the configuration of a GN 3 with PostGIS?

Thanks a lot
Òscar

--
_______________________________________________________________________

Oscar Chic
Sotsdirector Tècnic
Institut de Ciències del Mar (ICM-CSIC) Tel: +34 932309529
Pg. Marítim de la Barceloneta, 37-49 Fax: +34 932309555
08003 Barcelona, Spain email: ochic@anonymised.com
_______________________________________________________________________

Hi, i think you just need one database.
Either postgres (with postgis or not), either JNDI.
Try to use just the postgres config, remove your DB, create a new one, and
see if the serveur startup fills the new DB with correct tables.
You're then free to enable postgis extension in that base if you want to.

On Tue, May 26, 2015 at 2:36 PM, Òscar Chic <ochic@anonymised.com> wrote:

Hi,

I'm trying to configure a new Geonetwork 3 installed as a war file to
connect to postGIS

Before that I have a Geonetwork 2.10 running with this configuration
perfect:

---
   <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
     <!-- postgresql -->
     <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
     <resource enabled="true">
       <name>main-db</name>
<provider>jeeves.resources.dbms.ApacheDBCPool</provider>
       <config>
         <user>geonetwork</user>
         <password>xxxxxx</password>
         <!-- we use org.postgis.DriverWrapper in place of
                 org.postgresql.Driver to support both postgresql and
postgis -->
         <!--
         <driver>org.postgresql.Driver</driver>
                 -->
         <driver>org.postgis.DriverWrapper</driver>
         <!--
                     jdbc:postgresql:database
                     jdbc:postgresql://host/database
                     jdbc:postgresql://host:port/database

                     or if you are using postgis and want the spatial
index loaded
                     into postgis

                     jdbc:postgresql_postGIS://host:port/database

                 -->
<url>jdbc:postgresql_postGIS://coobd:5432/gn</url>
         <poolSize>10</poolSize>
         <validationQuery>SELECT 1</validationQuery>
       </config>
     </resource>
---

I'm trying to edit config-node/srv.xml file to use
config-db/postgresql.xml and config-db/jndi-postgres-postgis.xml
In first case I changed 2 lines:

        <!--<constructor-arg value="org.postgresql.Driver"/> -->
         <constructor-arg value="org.postgis.DriverWrapper"/>

         <!--<constructor-arg
value="jdbc:postgresql://${jdbc.host}:5432/${jdbc.database}"/> -->
         <constructor-arg value="jdbc:postgresql_postGIS://${jdbc.(user,
pass, host, dbhost}:5432/${jdbc.database}"/>

Then I update jdbc.properties (user, pass, host, db)

After that I create a clean PostGIS database with that parameters

Then reboot geonetwork but a lot of SEVERE errors related to datasource

Anybody knows the configuration of a GN 3 with PostGIS?

Thanks a lot
Òscar

--
_______________________________________________________________________

Oscar Chic
Sotsdirector Tècnic
Institut de Ciències del Mar (ICM-CSIC) Tel: +34 932309529
Pg. Marítim de la Barceloneta, 37-49 Fax: +34 932309555
08003 Barcelona, Spain email: ochic@anonymised.com
_______________________________________________________________________

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
Application Monitoring Software and Tool - ManageEngine Applications Manager
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
geonetwork-users List Signup and Options
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--
Florent Gravin
Camptocamp - Chambéry
0479444492

Hi,

I was struggling with connecting GNK with Postgres. This thread helped me a
lot. However, I still have a problem after I created postgis extension.

Now I am able to connect GNK with Postgres, but I want to use PostGIS for my
index since I have a large volume of datasets. I have already create postgis
extension in postgre DB, but I don't think PostGIS is being used (C:\Program
Files\geonetwork\web\geonetwork\WEB-INF\data\index), because the spatial
index file keeps getting larger as I add data. Do I need to do some other
configuration?

I found there are two files called postgis-alternate-datasource.xml and
postgis-shared-datasource.xml under C:\Program
Files\geonetwork\web\geonetwork\WEB-INF\config-db. I am wondering what they
mean.

Thanks in advance,
Cody

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/PostGIS-configuration-in-Geonetwork-3-tp5207603p5208511.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.