[GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi,

I just installed an instance of GeoNetwork (GN) v2.6.4 with PostgreSQL 9.1.4 on Ubuntu 12.04 LTS.

I also inserted a number of metadata records into my GN instance.

I'd like to take advantage of the spatial features provided by PostGIS (such as spatial indexing and etc.).

Can anyone provide me a pointer or guide on how to:
(a) enable PostGIS' spatial features in my GN instance
(b) migrate existing data to use the PostGIS spatial features without reinstalling or recreating the geonetwork database instance?

Thanks in advance for your help.

Richard

Hi Richard

You can find in
http://geonetwork-opensource.org/_static/foss4g2010/FOSS4G_Mastering_Advanced_GeoNetwork.pdfhow
to configure PostGIS in 2.6.4 to store the spatial index.

After the changes, restart GeoNetwork, go to Administration panel and click
on Rebuild Index button. That should update the spatial index to store it
in PostGIS.

Regards,
Jose García

On Wed, Sep 12, 2012 at 6:11 AM, <Richard.Goh@anonymised.com> wrote:

Hi,

I just installed an instance of GeoNetwork (GN) v2.6.4 with PostgreSQL
9.1.4 on Ubuntu 12.04 LTS.

I also inserted a number of metadata records into my GN instance.

I'd like to take advantage of the spatial features provided by PostGIS
(such as spatial indexing and etc.).

Can anyone provide me a pointer or guide on how to:
(a) enable PostGIS' spatial features in my GN instance
(b) migrate existing data to use the PostGIS spatial features without
reinstalling or recreating the geonetwork database instance?

Thanks in advance for your help.

Richard

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--
*
GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on
GeoServer and GeoNetwork. Visit http://geocat.net for details.
_________________________
Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net/&gt;

*

Hi,
there is a presentation called "Mastering Advanced GeoNetwork"
https://www.google.no/search?q=geonetwork+postgis
That's how I learned how to enable PostGIS in GN.

Migrating is probably more advanced. The spatial indexes are stored as shapefile(s) default (90% sure), maybe you can use ogr2ogr to convert to PostGIS.
http://www.gdal.org/ogr2ogr.html
Just a thought.

vennlig hilsen
Jørn-Vegard Røsnes

----- Original Message -----

Fra: "Richard Goh" <Richard.Goh@anonymised.com>
Til: geonetwork-users@lists.sourceforge.net
Sendt: 12. september 2012 06:11:42
Emne: [GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi,

I just installed an instance of GeoNetwork (GN) v2.6.4 with
PostgreSQL 9.1.4 on Ubuntu 12.04 LTS.

I also inserted a number of metadata records into my GN instance.

I'd like to take advantage of the spatial features provided by
PostGIS (such as spatial indexing and etc.).

Can anyone provide me a pointer or guide on how to:
(a) enable PostGIS' spatial features in my GN instance
(b) migrate existing data to use the PostGIS spatial features without
reinstalling or recreating the geonetwork database instance?

Thanks in advance for your help.

Richard
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond.
Discussions
will include endpoint security, mobile security and the latest in
malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

CONFIDENTIALITY
This e-mail and any attachment contain KONGSBERG information which may be
proprietary, confidential or subject to export regulations, and is only meant
for the intended recipient(s). Any disclosure, copying, distribution or use is
prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in
error, please delete it immediately from your system and notify the sender
properly.

Hi Jose,

Thanks for your prompt reply.

Now I’ve the postgis set up in my GN’s postgres database.

psql -d geonetwork -c "SELECT postgis_full_version();"

POSTGIS="1.5.3" GEOS="3.2.2-CAPI-1.6.2" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.8" USE_STATS
(1 row)

I checked my GN database and I can see geometry_columns, spatial_ref_sys and spatialindex tables. The geometry_columns table has got a single record, spatial_ref_sys has got 3749 records and spatialindex table has no record.

In the config.xml file, I’ve to change the JDBC to use the PostGIS JDBC driver as follows (my GN instance won’t run if I used this driver: org.postgresql.Driver):

<driver>org.postgis.DriverWrapper</driver>
<url>jdbc:postgresql_postGIS://<host>:5432/geonetwork</url>

I restarted the GN after the changes, re-built the ‘Lucene’ index (not sure if this index is the spatial index mentioned in your reply) and performed a search on the metadata records. I supposed the spatialindex table should be filled with the spatial index records. However, this is not the case. That table seems to be empty and not actually being used.

Just wonder if I missed out anything.

Cheers
Richard Goh

From: Jose Garcia [mailto:jose.garcia@…444…]
Sent: Wednesday, 12 September 2012 2:48 PM
To: Goh, Richard (CESRE, Kensington)
Cc: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi Richard

You can find in http://geonetwork-opensource.org/_static/foss4g2010/FOSS4G_Mastering_Advanced_GeoNetwork.pdf how to configure PostGIS in 2.6.4 to store the spatial index.

After the changes, restart GeoNetwork, go to Administration panel and click on Rebuild Index button. That should update the spatial index to store it in PostGIS.

Regards,
Jose García

On Wed, Sep 12, 2012 at 6:11 AM, <Richard.Goh@...448...<mailto:Richard.Goh@…448…>> wrote:
Hi,

I just installed an instance of GeoNetwork (GN) v2.6.4 with PostgreSQL 9.1.4 on Ubuntu 12.04 LTS.

I also inserted a number of metadata records into my GN instance.

I'd like to take advantage of the spatial features provided by PostGIS (such as spatial indexing and etc.).

Can anyone provide me a pointer or guide on how to:
(a) enable PostGIS' spatial features in my GN instance
(b) migrate existing data to use the PostGIS spatial features without reinstalling or recreating the geonetwork database instance?

Thanks in advance for your help.

Richard
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net<mailto:GeoNetwork-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

--
GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on GeoServer and GeoNetwork. Visit http://geocat.net/&gt; for details.
_________________________
Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net/&gt;

Hi Richard

I expected the spatial index was recreated in PostGis after rebuild index,
but seem not the case. Check if this works:

* Stop GeoNetwork

* Delete files in WEB-INF/lucene/spatial folder (make a backup, just in
case)

* Start GeoNetwork again

Hopefully that should work to recreate spatial index properly in PostGis.

Regards,
Jose García

On Wed, Sep 12, 2012 at 11:55 AM, <Richard.Goh@anonymised.com> wrote:

Hi Jose,****

** **

Thanks for your prompt reply.****

** **

Now I’ve the postgis set up in my GN’s postgres database.****

** **

psql -d geonetwork -c "SELECT postgis_full_version();"****

** **

POSTGIS="1.5.3" GEOS="3.2.2-CAPI-1.6.2" PROJ="Rel. 4.7.1, 23 September
2009" LIBXML="2.7.8" USE_STATS****

(1 row)****

** **

I checked my GN database and I can see geometry_columns, spatial_ref_sys
and spatialindex tables. The geometry_columns table has got a single
record, spatial_ref_sys has got 3749 records and spatialindex table has no
record.****

** **

In the config.xml file, I’ve to change the JDBC to use the PostGIS JDBC
driver as follows (my GN instance won’t run if I used this driver:
org.postgresql.Driver):****

** **

<driver>org.postgis.DriverWrapper</driver>****

<url>jdbc:postgresql_postGIS://<host>:5432/geonetwork</url>****

** **

I restarted the GN after the changes, re-built the ‘Lucene’ index (not
sure if this index is the spatial index mentioned in your reply) and
performed a search on the metadata records. I supposed the spatialindex
table should be filled with the spatial index records. However, this is not
the case. That table seems to be empty and not actually being used. ****

** **

Just wonder if I missed out anything.****

** **

Cheers****

Richard Goh****

** **

*From:* Jose Garcia [mailto:jose.garcia@anonymised.com]
*Sent:* Wednesday, 12 September 2012 2:48 PM
*To:* Goh, Richard (CESRE, Kensington)
*Cc:* geonetwork-users@lists.sourceforge.net
*Subject:* Re: [GeoNetwork-users] How to enable PostGIS spatial features
in Geonetwork 2.6.4?****

** **

Hi Richard****

** **

You can find in
http://geonetwork-opensource.org/_static/foss4g2010/FOSS4G_Mastering_Advanced_GeoNetwork.pdfhow to configure PostGIS in 2.6.4 to store the spatial index.
****

** **

After the changes, restart GeoNetwork, go to Administration panel and
click on Rebuild Index button. That should update the spatial index to
store it in PostGIS.****

** **

Regards,****

Jose García****

** **

On Wed, Sep 12, 2012 at 6:11 AM, <Richard.Goh@anonymised.com> wrote:****

Hi,

I just installed an instance of GeoNetwork (GN) v2.6.4 with PostgreSQL
9.1.4 on Ubuntu 12.04 LTS.

I also inserted a number of metadata records into my GN instance.

I'd like to take advantage of the spatial features provided by PostGIS
(such as spatial indexing and etc.).

Can anyone provide me a pointer or guide on how to:
(a) enable PostGIS' spatial features in my GN instance
(b) migrate existing data to use the PostGIS spatial features without
reinstalling or recreating the geonetwork database instance?

Thanks in advance for your help.

Richard

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork****

****

** **

-- **

GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on
GeoServer and GeoNetwork. Visit http://geocat.net for details. ****

_________________________****

Jose García****

GeoCat bv****

Veenderweg 13****

6721 WD Bennekom****

The Netherlands****

http://GeoCat.net/&gt;\*\*\*\*

** **

** **

--
*
GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on
GeoServer and GeoNetwork. Visit http://geocat.net for details.
_________________________
Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net/&gt;

*

Hi Jose,

I tried all the steps mentioned in your email.

The WEB-INF/lucene/spatial folder got recreated.

Unfortunately, I still can’t see the ‘spatialindex’ table get used by my Geonetwork instance.

I’m just wondering how does Geonetwork use the ‘spatialindex’ table. Will there be any performance issue if that table is not being used?

Many thanks for your help.

Cheers
Richard Goh

From: Jose Garcia [mailto:jose.garcia@…444…]
Sent: Wednesday, 12 September 2012 7:22 PM
To: Goh, Richard (CESRE, Kensington)
Cc: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi Richard

I expected the spatial index was recreated in PostGis after rebuild index, but seem not the case. Check if this works:

* Stop GeoNetwork

* Delete files in WEB-INF/lucene/spatial folder (make a backup, just in case)

* Start GeoNetwork again

Hopefully that should work to recreate spatial index properly in PostGis.

Regards,
Jose García

Hi Richard

About spatial index in PostGis, unless a very large catalog should not be a
performance issue. I think Simon Pigot did some comparisons and until 20
thousand records in catalog was fine to use shapefile for spatial
indexing. The spatial index is used in CSW and search UI bbox queries.

In your configuration I see you use this syntax:

<url>jdbc:postgresql_postGIS://<host>:5432/geonetwork</url>

Please use this instead:

<url>jdbc:postgis://<host>:5432/geonetwork</url>

Check also the geonetwork log file, should indicate in startup if really
using the spatial index in shapefile or PostGis. If using PostGis should
contain:

NOTE: Using POSTGIS for spatial index

otherwise:

Failed to create datastore for ..... Will use shapefile instead.

Regards,
Jose García

On Thu, Sep 13, 2012 at 3:20 AM, <Richard.Goh@anonymised.com> wrote:

Hi Jose,****

** **

I tried all the steps mentioned in your email. ****

** **

The WEB-INF/lucene/spatial folder got recreated.****

** **

Unfortunately, I still can’t see the ‘spatialindex’ table get used by my
Geonetwork instance. ****

** **

I’m just wondering how does Geonetwork use the ‘spatialindex’ table. Will
there be any performance issue if that table is not being used?****

** **

Many thanks for your help.****

** **

Cheers****

Richard Goh****

** **

*From:* Jose Garcia [mailto:jose.garcia@anonymised.com]
*Sent:* Wednesday, 12 September 2012 7:22 PM

*To:* Goh, Richard (CESRE, Kensington)
*Cc:* geonetwork-users@lists.sourceforge.net
*Subject:* Re: [GeoNetwork-users] How to enable PostGIS spatial features
in Geonetwork 2.6.4?****

** **

Hi Richard****

** **

I expected the spatial index was recreated in PostGis after rebuild index,
but seem not the case. Check if this works:****

** **

* Stop GeoNetwork****

** **

* Delete files in WEB-INF/lucene/spatial folder (make a backup, just in
case)****

** **

* Start GeoNetwork again****

** **

Hopefully that should work to recreate spatial index properly in PostGis.*
***

Regards,****

Jose García****

** **

** **

--
*
GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on
GeoServer and GeoNetwork. Visit http://geocat.net for details.
_________________________
Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net/&gt;

*

Hi Jose,

Thanks for explaining how the spatial indexing is used in Geonetwork.

The postgis JDBC string didn’t work. My Geonetwork instance failed to start with that JDBC string.

So I changed it back again to postgresql_postGIS and restarted the tomcat server.

I noticed the following in the geonetwork log file:

...
2012-09-13 17:22:45,061 INFO [jeeves.apphand] - Server is Enabled.
2012-09-13 17:22:45,063 INFO [jeeves.apphand] - - Search...
2012-09-13 17:22:45,063 INFO [jeeves.apphand] - Using shapefile /usr/local/geonetwork/WEB-INF/lucene/spatial/spatialindex.shp
2012-09-13 17:22:45,072 DEBUG [org.jzkit.z3950.server.Z3950Listener] - Starting ZServer on port 2100 (timeout=300000)
2012-09-13 17:22:45,079 DEBUG [org.jzkit.z3950.server.Z3950Listener] - Waiting for connection
2012-09-13 17:22:46,665 INFO [jeeves.apphand] - NOTE: Using shapefile for spatial index, this can be slow for larger catalogs
2012-09-13 17:22:46,745 DEBUG [geonetwork.stopwordparser] - StopwordParser parsing file: /usr/local/geonetwork/resources/stopwords/english_stop.txt
...

So I then searched for the datastore creation failure message but I couldn’t find any in the log neither the ‘Using the POSTGIS for spatial index’ message.

2012-09-13 17:22:41,639 INFO [jeeves.engine] - Initializing profiles...
2012-09-13 17:22:41,671 INFO [jeeves.engine] - Found handler : org.fao.geonet.Geonetwork
2012-09-13 17:22:41,706 INFO [jeeves.engine] - --- Starting handler --------------------------------------
2012-09-13 17:22:41,715 INFO [jeeves.apphand] - Initializing GeoNetwork 2.6.4.SNAPSHOT ...
2012-09-13 17:22:41,916 INFO [jeeves.apphand] - - Database connection on jdbc:postgresql_postGIS://<host>:5432/geonetwork ...
2012-09-13 17:22:41,985 INFO [jeeves.apphand] - Found an existing GeoNetwork database.
2012-09-13 17:22:41,985 INFO [jeeves.apphand] - - Setting manager...
2012-09-13 17:22:42,043 INFO [jeeves.apphand] - - Migration ...
2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Webapp version:2.6.4 subversion:SNAPSHOT
2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Database version:2.6.4 subversion:0
2012-09-13 17:22:42,044 INFO [jeeves.apphand] - Webapp version = Database version, no migration task to apply.
2012-09-13 17:22:42,044 INFO [jeeves.apphand] - - Thesaurus...
2012-09-13 17:22:42,448 DEBUG [geonetwork.thesaurus-man] - Adding thesaurus : external.place.regions
2012-09-13 17:22:43,015 DEBUG [geonetwork.thesaurus-man] - Adding thesaurus : external.theme.inspire-theme
2012-09-13 17:22:43,141 INFO [jeeves.apphand] - - Z39.50...
2012-09-13 17:22:43,199 INFO [jeeves.apphand] - Repositories file built from template.
2012-09-13 17:22:44,275 DEBUG [org.jzkit.search.util.RecordBuilder.RecordBuilderService] - new RecordBuilderService
2012-09-13 17:22:44,282 DEBUG [org.jzkit.search.util.RecordBuilder.RecordBuilderService] - RecordBuilderService::init
2012-09-13 17:22:44,665 DEBUG [org.jzkit.z3950.server.Z3950Listener] - new Z3950Listener()
2012-09-13 17:22:44,676 DEBUG [org.jzkit.service.z3950server.JZKitBackend] - New JZKitBackend 1752161445
2012-09-13 17:22:44,702 DEBUG [org.jzkit.configuration.provider.xml.InMemoryImpl] - setApplicationContext...
2012-09-13 17:22:44,702 DEBUG [org.jzkit.configuration.provider.xml.InMemoryImpl] - Load config: /JZKitConfig.xml
2012-09-13 17:22:44,704 DEBUG [org.jzkit.configuration.provider.xml.InMemoryImpl] - Loading rules : jar:file:/usr/local/geonetwork/WEB-IN
F/lib/jzkit-service-3.r260.geonetwork.patch.1.jar!/org/jzkit/configuration/provider/xml/DigesterRules.xml
2012-09-13 17:22:44,753 DEBUG [org.jzkit.configuration.provider.xml.InMemoryImpl] - Parsing config
2012-09-13 17:22:44,754 DEBUG [org.jzkit.configuration.provider.xml.InMemoryImpl] - registerClasspathProfile : profiles/geo.xml (ctx=org.
springframework.context.support.ClassPathXmlApplicationContext@...1154...: display name [org.springframework.context.support.ClassPathXmlAp
plicationContext@...1154...]; startup date [Thu Sep 13 17:22:43 EST 2012]; root of context hierarchy)

Cheers
Richard Goh

From: Jose Garcia [mailto:jose.garcia@…444…]
Sent: Thursday, 13 September 2012 2:44 PM
To: Goh, Richard (CESRE, Kensington)
Cc: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi Richard

About spatial index in PostGis, unless a very large catalog should not be a performance issue. I think Simon Pigot did some comparisons and until 20 thousand records in catalog was fine to use shapefile for spatial indexing. The spatial index is used in CSW and search UI bbox queries.

In your configuration I see you use this syntax:

<url>jdbc:postgresql_postGIS://<host>:5432/geonetwork</url>

Please use this instead:

<url>jdbc:postgis://<host>:5432/geonetwork</url>

Check also the geonetwork log file, should indicate in startup if really using the spatial index in shapefile or PostGis. If using PostGis should contain:

NOTE: Using POSTGIS for spatial index

otherwise:

Failed to create datastore for ..... Will use shapefile instead.

Regards,
Jose García

On Thu, Sep 13, 2012 at 3:20 AM, <Richard.Goh@...448...<mailto:Richard.Goh@…448…>> wrote:
Hi Jose,

I tried all the steps mentioned in your email.

The WEB-INF/lucene/spatial folder got recreated.

Unfortunately, I still can’t see the ‘spatialindex’ table get used by my Geonetwork instance.

I’m just wondering how does Geonetwork use the ‘spatialindex’ table. Will there be any performance issue if that table is not being used?

Many thanks for your help.

Cheers
Richard Goh

From: Jose Garcia [mailto:jose.garcia@…444…]
Sent: Wednesday, 12 September 2012 7:22 PM

To: Goh, Richard (CESRE, Kensington)
Cc: geonetwork-users@lists.sourceforge.net<mailto:geonetwork-users@lists.sourceforge.net>
Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi Richard

I expected the spatial index was recreated in PostGis after rebuild index, but seem not the case. Check if this works:

* Stop GeoNetwork

* Delete files in WEB-INF/lucene/spatial folder (make a backup, just in case)

* Start GeoNetwork again

Hopefully that should work to recreate spatial index properly in PostGis.

Regards,
Jose García

--
GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on GeoServer and GeoNetwork. Visit http://geocat.net/&gt; for details.
_________________________
Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net/&gt;

Hi Richard

From log file, it's using shapefile. I'll try to test tonight about the

connection string. In GeoNetwork 2.6.4 code is used this comparison to use
PostGis jdbc driver:

if (url.contains("postgis")) {

I think at some moment was used jdbc:postgis:... , but maybe I'm wrong or
was changed later to postgres_postgis. Anyway, the check in Java code seem
requires at least postgis written in lowercase in connection string (
postgresql_postgis).

Regards,
Jose García

On Thu, Sep 13, 2012 at 9:50 AM, <Richard.Goh@anonymised.com> wrote:

Hi Jose,****

** **

Thanks for explaining how the spatial indexing is used in Geonetwork.****

** **

The postgis JDBC string didn’t work. My Geonetwork instance failed to
start with that JDBC string.****

** **

So I changed it back again to postgresql_postGIS and restarted the tomcat
server.****

** **

I noticed the following in the geonetwork log file:****

** **

...****

2012-09-13 17:22:45,061 INFO [jeeves.apphand] - Server is Enabled.**
**

2012-09-13 17:22:45,063 INFO [jeeves.apphand] - - Search...****

2012-09-13 17:22:45,063 INFO [jeeves.apphand] - Using shapefile
/usr/local/geonetwork/WEB-INF/lucene/spatial/spatialindex.shp****

2012-09-13 17:22:45,072 DEBUG [org.jzkit.z3950.server.Z3950Listener] -
Starting ZServer on port 2100 (timeout=300000)****

2012-09-13 17:22:45,079 DEBUG [org.jzkit.z3950.server.Z3950Listener] -
Waiting for connection****

*2012-09-13 17:22:46,665 INFO [jeeves.apphand] - NOTE: Using shapefile
for spatial index, this can be slow for larger catalogs*

2012-09-13 17:22:46,745 DEBUG [geonetwork.stopwordparser] - StopwordParser
parsing file: /usr/local/geonetwork/resources/stopwords/english_stop.txt**
**

...****

** **

So I then searched for the datastore creation failure message but I
couldn’t find any in the log neither the ‘Using the POSTGIS for spatial
index’ message.****

** **

2012-09-13 17:22:41,639 INFO [jeeves.engine] - Initializing profiles...**
**

2012-09-13 17:22:41,671 INFO [jeeves.engine] - Found handler :
org.fao.geonet.Geonetwork****

2012-09-13 17:22:41,706 INFO [jeeves.engine] - --- Starting handler
--------------------------------------****

2012-09-13 17:22:41,715 INFO [jeeves.apphand] - Initializing GeoNetwork
2.6.4.SNAPSHOT ...****

*2012-09-13 17:22:41,916 INFO [jeeves.apphand] - - Database connection
on jdbc:postgresql_postGIS://<host>:5432/geonetwork ...*

*2012-09-13 17:22:41,985 INFO [jeeves.apphand] - Found an existing
GeoNetwork database.*

2012-09-13 17:22:41,985 INFO [jeeves.apphand] - - Setting manager...***
*

2012-09-13 17:22:42,043 INFO [jeeves.apphand] - - Migration ...****

2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Webapp
version:2.6.4 subversion:SNAPSHOT****

2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Database
version:2.6.4 subversion:0****

2012-09-13 17:22:42,044 INFO [jeeves.apphand] - Webapp version =
Database version, no migration task to apply.****

2012-09-13 17:22:42,044 INFO [jeeves.apphand] - - Thesaurus...****

2012-09-13 17:22:42,448 DEBUG [geonetwork.thesaurus-man] - Adding
thesaurus : external.place.regions****

2012-09-13 17:22:43,015 DEBUG [geonetwork.thesaurus-man] - Adding
thesaurus : external.theme.inspire-theme****

2012-09-13 17:22:43,141 INFO [jeeves.apphand] - - Z39.50...****

2012-09-13 17:22:43,199 INFO [jeeves.apphand] - Repositories file
built from template.****

2012-09-13 17:22:44,275 DEBUG
[org.jzkit.search.util.RecordBuilder.RecordBuilderService] - new
RecordBuilderService****

2012-09-13 17:22:44,282 DEBUG
[org.jzkit.search.util.RecordBuilder.RecordBuilderService] -
RecordBuilderService::init****

2012-09-13 17:22:44,665 DEBUG [org.jzkit.z3950.server.Z3950Listener] - new
Z3950Listener()****

2012-09-13 17:22:44,676 DEBUG [org.jzkit.service.z3950server.JZKitBackend]
- New JZKitBackend 1752161445****

2012-09-13 17:22:44,702 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] -
setApplicationContext...****

2012-09-13 17:22:44,702 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] - Load config:
/JZKitConfig.xml****

2012-09-13 17:22:44,704 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] - Loading rules :
jar:file:/usr/local/geonetwork/WEB-IN****

F/lib/jzkit-service-3.r260.geonetwork.patch.1.jar!/org/jzkit/configuration/provider/xml/DigesterRules.xml
****

2012-09-13 17:22:44,753 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] - Parsing config****

2012-09-13 17:22:44,754 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] -
registerClasspathProfile : profiles/geo.xml (ctx=org.****

springframework.context.support.ClassPathXmlApplicationContext@anonymised.com:
display name [org.springframework.context.support.ClassPathXmlAp****

plicationContext@anonymised.com]; startup date [Thu Sep 13 17:22:43 EST 2012];
root of context hierarchy)****

** **

Cheers****

Richard Goh****

** **

*From:* Jose Garcia [mailto:jose.garcia@anonymised.com]
*Sent:* Thursday, 13 September 2012 2:44 PM

*To:* Goh, Richard (CESRE, Kensington)
*Cc:* geonetwork-users@lists.sourceforge.net
*Subject:* Re: [GeoNetwork-users] How to enable PostGIS spatial features
in Geonetwork 2.6.4?****

** **

Hi Richard****

** **

About spatial index in PostGis, unless a very large catalog should not be
a performance issue. I think Simon Pigot did some comparisons and until 20
thousand records in catalog was fine to use shapefile for spatial
indexing. The spatial index is used in CSW and search UI bbox queries.****

** **

In your configuration I see you use this syntax:****

** **

<url>jdbc:postgresql_postGIS://<host>:5432/geonetwork</url>****

** **

Please use this instead:****

** **

<url>jdbc:postgis://<host>:5432/geonetwork</url>****

** **

Check also the geonetwork log file, should indicate in startup if really
using the spatial index in shapefile or PostGis. If using PostGis should
contain:****

** **

NOTE: Using POSTGIS for spatial index****

** **

otherwise:****

** **

Failed to create datastore for ..... Will use shapefile instead.****

** **

Regards,****

Jose García****

** **

On Thu, Sep 13, 2012 at 3:20 AM, <Richard.Goh@anonymised.com> wrote:****

Hi Jose,****

****

I tried all the steps mentioned in your email. ****

****

The WEB-INF/lucene/spatial folder got recreated.****

****

Unfortunately, I still can’t see the ‘spatialindex’ table get used by my
Geonetwork instance. ****

****

I’m just wondering how does Geonetwork use the ‘spatialindex’ table. Will
there be any performance issue if that table is not being used?****

****

Many thanks for your help.****

****

Cheers****

Richard Goh****

****

*From:* Jose Garcia [mailto:jose.garcia@anonymised.com]
*Sent:* Wednesday, 12 September 2012 7:22 PM****

*To:* Goh, Richard (CESRE, Kensington)
*Cc:* geonetwork-users@lists.sourceforge.net
*Subject:* Re: [GeoNetwork-users] How to enable PostGIS spatial features
in Geonetwork 2.6.4?****

****

Hi Richard****

****

I expected the spatial index was recreated in PostGis after rebuild index,
but seem not the case. Check if this works:****

****

* Stop GeoNetwork****

****

* Delete files in WEB-INF/lucene/spatial folder (make a backup, just in
case)****

****

* Start GeoNetwork again****

****

Hopefully that should work to recreate spatial index properly in PostGis.*
***

Regards,****

Jose García****

****

****

****

** **

-- **

GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on
GeoServer and GeoNetwork. Visit http://geocat.net for details. ****

_________________________****

Jose García****

GeoCat bv****

Veenderweg 13****

6721 WD Bennekom****

The Netherlands****

http://GeoCat.net/&gt;\*\*\*\*

** **

** **

--
*
GeoCat Bridge for ArcGIS allows instant publishing of data and metadata on
GeoServer and GeoNetwork. Visit http://geocat.net for details.
_________________________
Jose García
GeoCat bv
Veenderweg 13
6721 WD Bennekom
The Netherlands
http://GeoCat.net/&gt;

*

Hi Jose,

Many thanks for your quick response.

I changed the connection string to lowercase and the database connection failed. See error log below:

2012-09-13 18:01:55,135 INFO [jeeves.engine] - --- Starting handler --------------------------------------
2012-09-13 18:01:55,136 INFO [jeeves.apphand] - Initializing GeoNetwork 2.6.4.SNAPSHOT ...
2012-09-13 18:01:55,326 INFO [jeeves.apphand] - Failed to open database connection, Check config.xml db file configuration.Error is:
null
2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Raised exception while starting appl handler. Skipped.
2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Handler : org.fao.geonet.Geonetwork
2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Exception : java.lang.NullPointerException
2012-09-13 18:01:55,327 ERROR [jeeves.engine] - Message : null
2012-09-13 18:01:55,327 ERROR [jeeves.engine] - Stack : java.lang.NullPointerException
        at org.fao.geonet.Geonetwork.initDatabase(Geonetwork.java:405)
        at org.fao.geonet.Geonetwork.start(Geonetwork.java:131)
        at jeeves.server.JeevesEngine.initAppHandler(JeevesEngine.java:475)
        at jeeves.server.JeevesEngine.init(JeevesEngine.java:155)
        at jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:74)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja

If the postgis needs to be in lowercase then the code will need to be fixed unless there is a workaround.

Cheers
Richard Goh

From: Jose Garcia [mailto:jose.garcia@…444…]
Sent: Thursday, 13 September 2012 3:59 PM
To: Goh, Richard (CESRE, Kensington)
Cc: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi Richard

From log file, it's using shapefile. I'll try to test tonight about the connection string. In GeoNetwork 2.6.4 code is used this comparison to use PostGis jdbc driver:

if (url.contains("postgis")) {

I think at some moment was used jdbc:postgis:... , but maybe I'm wrong or was changed later to postgres_postgis. Anyway, the check in Java code seem requires at least postgis written in lowercase in connection string (postgresql_postgis).

Regards,
Jose García

On Thu, Sep 13, 2012 at 9:50 AM, <Richard.Goh@...448...<mailto:Richard.Goh@…448…>> wrote:
Hi Jose,

Thanks for explaining how the spatial indexing is used in Geonetwork.

The postgis JDBC string didn’t work. My Geonetwork instance failed to start with that JDBC string.

So I changed it back again to postgresql_postGIS and restarted the tomcat server.

I noticed the following in the geonetwork log file:

...
2012-09-13 17:22:45,061 INFO [jeeves.apphand] - Server is Enabled.
2012-09-13 17:22:45,063 INFO [jeeves.apphand] - - Search...
2012-09-13 17:22:45,063 INFO [jeeves.apphand] - Using shapefile /usr/local/geonetwork/WEB-INF/lucene/spatial/spatialindex.shp
2012-09-13 17:22:45,072 DEBUG [org.jzkit.z3950.server.Z3950Listener] - Starting ZServer on port 2100 (timeout=300000)
2012-09-13 17:22:45,079 DEBUG [org.jzkit.z3950.server.Z3950Listener] - Waiting for connection
2012-09-13 17:22:46,665 INFO [jeeves.apphand] - NOTE: Using shapefile for spatial index, this can be slow for larger catalogs
2012-09-13 17:22:46,745 DEBUG [geonetwork.stopwordparser] - StopwordParser parsing file: /usr/local/geonetwork/resources/stopwords/english_stop.txt
...

So I then searched for the datastore creation failure message but I couldn’t find any in the log neither the ‘Using the POSTGIS for spatial index’ message.

2012-09-13 17:22:41,639 INFO [jeeves.engine] - Initializing profiles...
2012-09-13 17:22:41,671 INFO [jeeves.engine] - Found handler : org.fao.geonet.Geonetwork
2012-09-13 17:22:41,706 INFO [jeeves.engine] - --- Starting handler --------------------------------------
2012-09-13 17:22:41,715 INFO [jeeves.apphand] - Initializing GeoNetwork 2.6.4.SNAPSHOT ...
2012-09-13 17:22:41,916 INFO [jeeves.apphand] - - Database connection on jdbc:postgresql_postGIS://<host>:5432/geonetwork ...
2012-09-13 17:22:41,985 INFO [jeeves.apphand] - Found an existing GeoNetwork database.
2012-09-13 17:22:41,985 INFO [jeeves.apphand] - - Setting manager...
2012-09-13 17:22:42,043 INFO [jeeves.apphand] - - Migration ...
2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Webapp version:2.6.4 subversion:SNAPSHOT
2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Database version:2.6.4 subversion:0
2012-09-13 17:22:42,044 INFO [jeeves.apphand] - Webapp version = Database version, no migration task to apply.
2012-09-13 17:22:42,044 INFO [jeeves.apphand] - - Thesaurus...
2012-09-13 17:22:42,448 DEBUG [geonetwork.thesaurus-man] - Adding thesaurus : external.place.regions
2012-09-13 17:22:43,015 DEBUG [geonetwork.thesaurus-man] - Adding thesaurus : external.theme.inspire-theme
2012-09-13 17:22:43,141 INFO [jeeves.apphand] - - Z39.50...
2012-09-13 17:22:43,199 INFO [jeeves.apphand] - Repositories file built from template.
2012-09-13 17:22:44,275 DEBUG [org.jzkit.search.util.RecordBuilder.RecordBuilderService] - new RecordBuilderService
2012-09-13 17:22:44,282 DEBUG [org.jzkit.search.util.RecordBuilder.RecordBuilderService] - RecordBuilderService::init
2012-09-13 17:22:44,665 DEBUG [org.jzkit.z3950.server.Z3950Listener] - new Z3950Listener()
2012-09-13 17:22:44,676 DEBUG [org.jzkit.service.z3950server.JZKitBackend] - New JZKitBackend 1752161445
2012-09-13 17:22:44,702 DEBUG [org.jzkit.configuration.provider.xml.InMemoryImpl] - setApplicationContext...
2012-09-13 17:22:44,702 DEBUG [org.jzkit.configuration.provider.xml.InMemoryImpl] - Load config: /JZKitConfig.xml
2012-09-13 17:22:44,704 DEBUG [org.jzkit.configuration.provider.xml.InMemoryImpl] - Loading rules : jar:file:/usr/local/geonetwork/WEB-IN
F/lib/jzkit-service-3.r260.geonetwork.patch.1.jar!/org/jzkit/configuration/provider/xml/DigesterRules.xml
2012-09-13 17:22:44,753 DEBUG [org.jzkit.configuration.provider.xml.InMemoryImpl] - Parsing config
2012-09-13 17:22:44,754 DEBUG [org.jzkit.configuration.provider.xml.InMemoryImpl] - registerClasspathProfile : profiles/geo.xml (ctx=org.
springframework.context.support.ClassPathXmlApplicationContext@...1154...<mailto:springframework.context.support.ClassPathXmlApplicationContext@…1154…>: display name [org.springframework.context.support.ClassPathXmlAp
plicationContext@...1154...]; startup date [Thu Sep 13 17:22:43 EST 2012]; root of context hierarchy)

Cheers
Richard Goh

Hi,

here is our config.xml for PostGIS.

<resource enabled="true">
    <name>main-db</name>
    <provider>jeeves.resources.dbms.DbmsPool</provider>
    <config>
      <user>geonetwork</user>
      <password>pw</password>
      <driver>org.postgresql.Driver</driver>
      <url>jdbc:postgis://localhost:5432/geonetwork</url>
      <poolSize>10</poolSize>
    </config>
</resource>

In the database we have entries in the spatialindex table and I can't find errors in the log file.

Please note:
- enabled="true", must be set enabled="false" for the other db-resource-entries in config.xml
- short-versions of resource/config/url in xml seems to fail (often), long-version with port-number works.
Short-versions tested:
jdbc:postgresql:database
jdbc:postgresql://host/database
ref. http://www.petefreitag.com/articles/jdbc_urls/

kind regards
Jørn-Vegard Røsnes

----- Original Message -----

Fra: "Richard Goh" <Richard.Goh@anonymised.com>
Til: "jose garcia" <jose.garcia@anonymised.com>
Kopi: geonetwork-users@lists.sourceforge.net
Sendt: 13. september 2012 10:11:57
Emne: Re: [GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi Jose,

Many thanks for your quick response.

I changed the connection string to lowercase and the database
connection failed. See error log below:

2012-09-13 18:01:55,135 INFO [jeeves.engine] - --- Starting handler
--------------------------------------
2012-09-13 18:01:55,136 INFO [jeeves.apphand] - Initializing
GeoNetwork 2.6.4.SNAPSHOT ...
2012-09-13 18:01:55,326 INFO [jeeves.apphand] - Failed to open
database connection, Check config.xml db file configuration.Error
is:
null
2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Raised exception
while starting appl handler. Skipped.
2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Handler :
org.fao.geonet.Geonetwork
2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Exception :
java.lang.NullPointerException
2012-09-13 18:01:55,327 ERROR [jeeves.engine] - Message : null
2012-09-13 18:01:55,327 ERROR [jeeves.engine] - Stack :
java.lang.NullPointerException
        at
        org.fao.geonet.Geonetwork.initDatabase(Geonetwork.java:405)
        at org.fao.geonet.Geonetwork.start(Geonetwork.java:131)
        at
        jeeves.server.JeevesEngine.initAppHandler(JeevesEngine.java:475)
        at jeeves.server.JeevesEngine.init(JeevesEngine.java:155)
        at
        jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:74)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at
        org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
        at
        org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
        at
        org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
        at
        org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
        at
        org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at
        org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        at
        org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        at
        org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja

If the postgis needs to be in lowercase then the code will need to be
fixed unless there is a workaround.

Cheers
Richard Goh

From: Jose Garcia [mailto:jose.garcia@anonymised.com]
Sent: Thursday, 13 September 2012 3:59 PM
To: Goh, Richard (CESRE, Kensington)
Cc: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial
features in Geonetwork 2.6.4?

Hi Richard

From log file, it's using shapefile. I'll try to test tonight about
the connection string. In GeoNetwork 2.6.4 code is used this
comparison to use PostGis jdbc driver:

if (url.contains("postgis")) {

I think at some moment was used jdbc:postgis:... , but maybe I'm
wrong or was changed later to postgres_postgis. Anyway, the check in
Java code seem requires at least postgis written in lowercase in
connection string (postgresql_postgis).

Regards,
Jose García

On Thu, Sep 13, 2012 at 9:50 AM,
<Richard.Goh@anonymised.com<mailto:Richard.Goh@anonymised.com>> wrote:
Hi Jose,

Thanks for explaining how the spatial indexing is used in Geonetwork.

The postgis JDBC string didn’t work. My Geonetwork instance failed to
start with that JDBC string.

So I changed it back again to postgresql_postGIS and restarted the
tomcat server.

I noticed the following in the geonetwork log file:

...
2012-09-13 17:22:45,061 INFO [jeeves.apphand] - Server is
Enabled.
2012-09-13 17:22:45,063 INFO [jeeves.apphand] - - Search...
2012-09-13 17:22:45,063 INFO [jeeves.apphand] - Using shapefile
/usr/local/geonetwork/WEB-INF/lucene/spatial/spatialindex.shp
2012-09-13 17:22:45,072 DEBUG [org.jzkit.z3950.server.Z3950Listener]
- Starting ZServer on port 2100 (timeout=300000)
2012-09-13 17:22:45,079 DEBUG [org.jzkit.z3950.server.Z3950Listener]
- Waiting for connection
2012-09-13 17:22:46,665 INFO [jeeves.apphand] - NOTE: Using
shapefile for spatial index, this can be slow for larger catalogs
2012-09-13 17:22:46,745 DEBUG [geonetwork.stopwordparser] -
StopwordParser parsing file:
/usr/local/geonetwork/resources/stopwords/english_stop.txt
...

So I then searched for the datastore creation failure message but I
couldn’t find any in the log neither the ‘Using the POSTGIS for
spatial index’ message.

2012-09-13 17:22:41,639 INFO [jeeves.engine] - Initializing
profiles...
2012-09-13 17:22:41,671 INFO [jeeves.engine] - Found handler :
org.fao.geonet.Geonetwork
2012-09-13 17:22:41,706 INFO [jeeves.engine] - --- Starting handler
--------------------------------------
2012-09-13 17:22:41,715 INFO [jeeves.apphand] - Initializing
GeoNetwork 2.6.4.SNAPSHOT ...
2012-09-13 17:22:41,916 INFO [jeeves.apphand] - - Database
connection on jdbc:postgresql_postGIS://<host>:5432/geonetwork ...
2012-09-13 17:22:41,985 INFO [jeeves.apphand] - Found an
existing GeoNetwork database.
2012-09-13 17:22:41,985 INFO [jeeves.apphand] - - Setting
manager...
2012-09-13 17:22:42,043 INFO [jeeves.apphand] - - Migration ...
2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Webapp
  version:2.6.4 subversion:SNAPSHOT
2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Database
version:2.6.4 subversion:0
2012-09-13 17:22:42,044 INFO [jeeves.apphand] - Webapp version
= Database version, no migration task to apply.
2012-09-13 17:22:42,044 INFO [jeeves.apphand] - - Thesaurus...
2012-09-13 17:22:42,448 DEBUG [geonetwork.thesaurus-man] - Adding
thesaurus : external.place.regions
2012-09-13 17:22:43,015 DEBUG [geonetwork.thesaurus-man] - Adding
thesaurus : external.theme.inspire-theme
2012-09-13 17:22:43,141 INFO [jeeves.apphand] - - Z39.50...
2012-09-13 17:22:43,199 INFO [jeeves.apphand] - Repositories
file built from template.
2012-09-13 17:22:44,275 DEBUG
[org.jzkit.search.util.RecordBuilder.RecordBuilderService] - new
RecordBuilderService
2012-09-13 17:22:44,282 DEBUG
[org.jzkit.search.util.RecordBuilder.RecordBuilderService] -
RecordBuilderService::init
2012-09-13 17:22:44,665 DEBUG [org.jzkit.z3950.server.Z3950Listener]
- new Z3950Listener()
2012-09-13 17:22:44,676 DEBUG
[org.jzkit.service.z3950server.JZKitBackend] - New JZKitBackend
1752161445
2012-09-13 17:22:44,702 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] -
setApplicationContext...
2012-09-13 17:22:44,702 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] - Load config:
/JZKitConfig.xml
2012-09-13 17:22:44,704 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] - Loading rules
: jar:file:/usr/local/geonetwork/WEB-IN
F/lib/jzkit-service-3.r260.geonetwork.patch.1.jar!/org/jzkit/configuration/provider/xml/DigesterRules.xml
2012-09-13 17:22:44,753 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] - Parsing config
2012-09-13 17:22:44,754 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] -
registerClasspathProfile : profiles/geo.xml (ctx=org.
springframework.context.support.ClassPathXmlApplicationContext@anonymised.com<mailto:springframework.context.support.ClassPathXmlApplicationContext@anonymised.com154…>:
display name [org.springframework.context.support.ClassPathXmlAp
plicationContext@anonymised.com]; startup date [Thu Sep 13 17:22:43 EST
2012]; root of context hierarchy)

Cheers
Richard Goh
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond.
Discussions
will include endpoint security, mobile security and the latest in
malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

CONFIDENTIALITY
This e-mail and any attachment contain KONGSBERG information which may be
proprietary, confidential or subject to export regulations, and is only meant
for the intended recipient(s). Any disclosure, copying, distribution or use is
prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in
error, please delete it immediately from your system and notify the sender
properly.

Hi Jørn,

Thanks for your email.

I tried your database configuration and the database connection still failed.

However, I got more error now in geonetwork log file.

Here is the error log:

2012-09-13 19:12:54,872 INFO [jeeves.engine] - Initializing resources...
2012-09-13 19:12:54,873 INFO [jeeves.engine] - Adding resource : main-db
2012-09-13 19:12:54,981 ERROR [jeeves.engine] - Raised exception while initializing resource. Skipped.
2012-09-13 19:12:54,982 ERROR [jeeves.engine] - Resource : main-db
2012-09-13 19:12:54,982 ERROR [jeeves.engine] - Provider : jeeves.resources.dbms.DbmsPool
2012-09-13 19:12:54,982 ERROR [jeeves.engine] - Exception : org.postgresql.util.PSQLException: The class class org.postgis.PGbox2d does not implement org.postgresql.util.PGobject.
2012-09-13 19:12:54,982 ERROR [jeeves.engine] - Message : The class class org.postgis.PGbox2d does not implement org.postgresql.util.PGobject.
2012-09-13 19:12:54,983 ERROR [jeeves.engine] - Stack : org.postgresql.util.PSQLException: The class class org.postgis.PGbox2d does not implement org.postgresql.util.PGobject.
        at org.postgresql.jdbc2.TypeInfoCache.addDataType(TypeInfoCache.java:163)
        at org.postgresql.jdbc2.AbstractJdbc2Connection.addDataType(AbstractJdbc2Connection.java:482)
        at org.postgresql.jdbc2.AbstractJdbc2Connection.initObjectTypes(AbstractJdbc2Connection.java:519)
        at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:172)
        at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
        at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
        at org.postgresql.Driver.makeConnection(Driver.java:393)
        at org.postgresql.Driver.connect(Driver.java:267)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at jeeves.resources.dbms.Dbms.connect(Dbms.java:88)
        at jeeves.resources.dbms.DbmsPool.init(DbmsPool.java:90)
        at jeeves.server.resources.ProviderManager.register(ProviderManager.java:54)
        at jeeves.server.JeevesEngine.initResources(JeevesEngine.java:426)
        at jeeves.server.JeevesEngine.loadConfigFile(JeevesEngine.java:268)
        at jeeves.server.JeevesEngine.init(JeevesEngine.java:146)
        at jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:74)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)

...

2012-09-13 19:18:36,458 INFO [jeeves.engine] - --- Starting handler --------------------------------------
2012-09-13 19:18:36,459 INFO [jeeves.apphand] - Initializing GeoNetwork 2.6.4.SNAPSHOT ...
2012-09-13 19:18:36,614 INFO [jeeves.apphand] - Failed to open database connection, Check config.xml db file configuration.Error is:
null
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Raised exception while starting appl handler. Skipped.
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Handler : org.fao.geonet.Geonetwork
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Exception : java.lang.NullPointerException
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Message : null
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Stack : java.lang.NullPointerException
        at org.fao.geonet.Geonetwork.initDatabase(Geonetwork.java:405)
        at org.fao.geonet.Geonetwork.start(Geonetwork.java:131)
        at jeeves.server.JeevesEngine.initAppHandler(JeevesEngine.java:475)
        at jeeves.server.JeevesEngine.init(JeevesEngine.java:155)
        at jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:74)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)

Here is a list of JDBC drivers in my GN installation:

/WEB-INF/lib
...
-rw-r--r-- 1 tomcat6 tomcat6 12121 Mar 3 2010 postgis-driver-1.0.jar
-rw-r--r-- 1 tomcat6 tomcat6 472831 Mar 3 2010 postgresql-8.4-701.jdbc3.jar

/usr/share/tomcat6/lib
...
lrwxrwxrwx 1 root root 22 Aug 22 15:20 /usr/share/tomcat6/lib/postgis.jar -> ../../java/postgis.jar
lrwxrwxrwx 1 root root 31 Aug 22 18:50 /usr/share/tomcat6/lib/postgresql-jdbc3.jar -> ../../java/postgresql-jdbc3.jar

Cheers
Richard Goh

-----Original Message-----
From: Jørn Vegard Røsnes [mailto:jorn@…272…]
Sent: Thursday, 13 September 2012 5:08 PM
To: Goh, Richard (CESRE, Kensington)
Cc: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi,

here is our config.xml for PostGIS.

<resource enabled="true">
    <name>main-db</name>
    <provider>jeeves.resources.dbms.DbmsPool</provider>
    <config>
      <user>geonetwork</user>
      <password>pw</password>
      <driver>org.postgresql.Driver</driver>
      <url>jdbc:postgis://localhost:5432/geonetwork</url>
      <poolSize>10</poolSize>
    </config>
</resource>

In the database we have entries in the spatialindex table and I can't find errors in the log file.

Please note:
- enabled="true", must be set enabled="false" for the other db-resource-entries in config.xml
- short-versions of resource/config/url in xml seems to fail (often), long-version with port-number works.
Short-versions tested:
jdbc:postgresql:database
jdbc:postgresql://host/database
ref. http://www.petefreitag.com/articles/jdbc_urls/

kind regards
Jørn-Vegard Røsnes

----- Original Message -----

Fra: "Richard Goh" <Richard.Goh@...448...>
Til: "jose garcia" <jose.garcia@...444...>
Kopi: geonetwork-users@lists.sourceforge.net
Sendt: 13. september 2012 10:11:57
Emne: Re: [GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi Jose,

Many thanks for your quick response.

I changed the connection string to lowercase and the database
connection failed. See error log below:

2012-09-13 18:01:55,135 INFO [jeeves.engine] - --- Starting handler
--------------------------------------
2012-09-13 18:01:55,136 INFO [jeeves.apphand] - Initializing
GeoNetwork 2.6.4.SNAPSHOT ...
2012-09-13 18:01:55,326 INFO [jeeves.apphand] - Failed to open
database connection, Check config.xml db file configuration.Error
is:
null
2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Raised exception while
starting appl handler. Skipped.
2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Handler :
org.fao.geonet.Geonetwork
2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Exception :
java.lang.NullPointerException
2012-09-13 18:01:55,327 ERROR [jeeves.engine] - Message : null
2012-09-13 18:01:55,327 ERROR [jeeves.engine] - Stack :
java.lang.NullPointerException
        at
        org.fao.geonet.Geonetwork.initDatabase(Geonetwork.java:405)
        at org.fao.geonet.Geonetwork.start(Geonetwork.java:131)
        at
        jeeves.server.JeevesEngine.initAppHandler(JeevesEngine.java:475)
        at jeeves.server.JeevesEngine.init(JeevesEngine.java:155)
        at
        jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:74)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at
        org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
        at
        org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
        at
        org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
        at
        org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
        at
        org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at
        org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        at
        org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        at

org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja

If the postgis needs to be in lowercase then the code will need to be
fixed unless there is a workaround.

Cheers
Richard Goh

From: Jose Garcia [mailto:jose.garcia@…444…]
Sent: Thursday, 13 September 2012 3:59 PM
To: Goh, Richard (CESRE, Kensington)
Cc: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial features
in Geonetwork 2.6.4?

Hi Richard

From log file, it's using shapefile. I'll try to test tonight about
the connection string. In GeoNetwork 2.6.4 code is used this
comparison to use PostGis jdbc driver:

if (url.contains("postgis")) {

I think at some moment was used jdbc:postgis:... , but maybe I'm wrong
or was changed later to postgres_postgis. Anyway, the check in Java
code seem requires at least postgis written in lowercase in connection
string (postgresql_postgis).

Regards,
Jose García

On Thu, Sep 13, 2012 at 9:50 AM,
<Richard.Goh@...448...<mailto:Richard.Goh@…448…>> wrote:
Hi Jose,

Thanks for explaining how the spatial indexing is used in Geonetwork.

The postgis JDBC string didn’t work. My Geonetwork instance failed to
start with that JDBC string.

So I changed it back again to postgresql_postGIS and restarted the
tomcat server.

I noticed the following in the geonetwork log file:

...
2012-09-13 17:22:45,061 INFO [jeeves.apphand] - Server is
Enabled.
2012-09-13 17:22:45,063 INFO [jeeves.apphand] - - Search...
2012-09-13 17:22:45,063 INFO [jeeves.apphand] - Using shapefile
/usr/local/geonetwork/WEB-INF/lucene/spatial/spatialindex.shp
2012-09-13 17:22:45,072 DEBUG [org.jzkit.z3950.server.Z3950Listener]
- Starting ZServer on port 2100 (timeout=300000)
2012-09-13 17:22:45,079 DEBUG [org.jzkit.z3950.server.Z3950Listener]
- Waiting for connection
2012-09-13 17:22:46,665 INFO [jeeves.apphand] - NOTE: Using shapefile
for spatial index, this can be slow for larger catalogs
2012-09-13 17:22:46,745 DEBUG [geonetwork.stopwordparser] -
StopwordParser parsing file:
/usr/local/geonetwork/resources/stopwords/english_stop.txt
...

So I then searched for the datastore creation failure message but I
couldn’t find any in the log neither the ‘Using the POSTGIS for
spatial index’ message.

2012-09-13 17:22:41,639 INFO [jeeves.engine] - Initializing
profiles...
2012-09-13 17:22:41,671 INFO [jeeves.engine] - Found handler :
org.fao.geonet.Geonetwork
2012-09-13 17:22:41,706 INFO [jeeves.engine] - --- Starting handler
--------------------------------------
2012-09-13 17:22:41,715 INFO [jeeves.apphand] - Initializing
GeoNetwork 2.6.4.SNAPSHOT ...
2012-09-13 17:22:41,916 INFO [jeeves.apphand] - - Database
connection on jdbc:postgresql_postGIS://<host>:5432/geonetwork ...
2012-09-13 17:22:41,985 INFO [jeeves.apphand] - Found an
existing GeoNetwork database.
2012-09-13 17:22:41,985 INFO [jeeves.apphand] - - Setting
manager...
2012-09-13 17:22:42,043 INFO [jeeves.apphand] - - Migration ...
2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Webapp
  version:2.6.4 subversion:SNAPSHOT
2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Database
version:2.6.4 subversion:0
2012-09-13 17:22:42,044 INFO [jeeves.apphand] - Webapp version
= Database version, no migration task to apply.
2012-09-13 17:22:42,044 INFO [jeeves.apphand] - - Thesaurus...
2012-09-13 17:22:42,448 DEBUG [geonetwork.thesaurus-man] - Adding
thesaurus : external.place.regions
2012-09-13 17:22:43,015 DEBUG [geonetwork.thesaurus-man] - Adding
thesaurus : external.theme.inspire-theme
2012-09-13 17:22:43,141 INFO [jeeves.apphand] - - Z39.50...
2012-09-13 17:22:43,199 INFO [jeeves.apphand] - Repositories
file built from template.
2012-09-13 17:22:44,275 DEBUG
[org.jzkit.search.util.RecordBuilder.RecordBuilderService] - new
RecordBuilderService
2012-09-13 17:22:44,282 DEBUG
[org.jzkit.search.util.RecordBuilder.RecordBuilderService] -
RecordBuilderService::init
2012-09-13 17:22:44,665 DEBUG [org.jzkit.z3950.server.Z3950Listener]
- new Z3950Listener()
2012-09-13 17:22:44,676 DEBUG
[org.jzkit.service.z3950server.JZKitBackend] - New JZKitBackend
1752161445
2012-09-13 17:22:44,702 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] -
setApplicationContext...
2012-09-13 17:22:44,702 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] - Load config:
/JZKitConfig.xml
2012-09-13 17:22:44,704 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] - Loading rules
: jar:file:/usr/local/geonetwork/WEB-IN
F/lib/jzkit-service-3.r260.geonetwork.patch.1.jar!/org/jzkit/configura
tion/provider/xml/DigesterRules.xml
2012-09-13 17:22:44,753 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] - Parsing config
2012-09-13 17:22:44,754 DEBUG
[org.jzkit.configuration.provider.xml.InMemoryImpl] -
registerClasspathProfile : profiles/geo.xml (ctx=org.
springframework.context.support.ClassPathXmlApplicationContext@...1154...<mailto:springframework.context.support.ClassPathXmlApplicationContext@…1154…>:
display name [org.springframework.context.support.ClassPathXmlAp
plicationContext@...1154...]; startup date [Thu Sep 13 17:22:43 EST
2012]; root of context hierarchy)

Cheers
Richard Goh
----------------------------------------------------------------------
--------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond.
Discussions
will include endpoint security, mobile security and the latest in
malware threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

CONFIDENTIALITY
This e-mail and any attachment contain KONGSBERG information which may be proprietary, confidential or subject to export regulations, and is only meant for the intended recipient(s). Any disclosure, copying, distribution or use is prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in error, please delete it immediately from your system and notify the sender properly.

Hi,

the error message:
The class class org.postgis.PGbox2d does not implement org.postgresql.util.PGobject
indicates a jar conflict.
https://www.google.no/search?q=The+class+class+org.postgis.PGbox2d+does+not+implement+org.postgresql.util.PGobject

I would suggest to move these elsewhere (remove soft links?):
/usr/share/tomcat6/lib
lrwxrwxrwx 1 root root 22 Aug 22 15:20 /usr/share/tomcat6/lib/postgis.jar -> ../../java/postgis.jar
lrwxrwxrwx 1 root root 31 Aug 22 18:50 /usr/share/tomcat6/lib/postgresql-jdbc3.jar -> ../../java/postgresql-jdbc3.jar

vennlig hilsen
Jørn-Vegard Røsnes

----- Original Message -----

Fra: "Richard Goh" <Richard.Goh@anonymised.com>
Til: jorn@anonymised.com
Kopi: geonetwork-users@lists.sourceforge.net
Sendt: 13. september 2012 11:33:57
Emne: RE: [GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi Jørn,

Thanks for your email.

I tried your database configuration and the database connection still
failed.

However, I got more error now in geonetwork log file.

Here is the error log:

2012-09-13 19:12:54,872 INFO [jeeves.engine] - Initializing
resources...
2012-09-13 19:12:54,873 INFO [jeeves.engine] - Adding resource :
main-db
2012-09-13 19:12:54,981 ERROR [jeeves.engine] - Raised exception
while initializing resource. Skipped.
2012-09-13 19:12:54,982 ERROR [jeeves.engine] - Resource :
main-db
2012-09-13 19:12:54,982 ERROR [jeeves.engine] - Provider :
jeeves.resources.dbms.DbmsPool
2012-09-13 19:12:54,982 ERROR [jeeves.engine] - Exception :
org.postgresql.util.PSQLException: The class class
org.postgis.PGbox2d does not implement org.postgresql.util.PGobject.
2012-09-13 19:12:54,982 ERROR [jeeves.engine] - Message : The
class class org.postgis.PGbox2d does not implement
org.postgresql.util.PGobject.
2012-09-13 19:12:54,983 ERROR [jeeves.engine] - Stack :
org.postgresql.util.PSQLException: The class class
org.postgis.PGbox2d does not implement org.postgresql.util.PGobject.
        at
        org.postgresql.jdbc2.TypeInfoCache.addDataType(TypeInfoCache.java:163)
        at
        org.postgresql.jdbc2.AbstractJdbc2Connection.addDataType(AbstractJdbc2Connection.java:482)
        at
        org.postgresql.jdbc2.AbstractJdbc2Connection.initObjectTypes(AbstractJdbc2Connection.java:519)
        at
        org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:172)
        at
        org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
        at
        org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
        at org.postgresql.Driver.makeConnection(Driver.java:393)
        at org.postgresql.Driver.connect(Driver.java:267)
        at
        java.sql.DriverManager.getConnection(DriverManager.java:582)
        at
        java.sql.DriverManager.getConnection(DriverManager.java:185)
        at jeeves.resources.dbms.Dbms.connect(Dbms.java:88)
        at jeeves.resources.dbms.DbmsPool.init(DbmsPool.java:90)
        at
        jeeves.server.resources.ProviderManager.register(ProviderManager.java:54)
        at
        jeeves.server.JeevesEngine.initResources(JeevesEngine.java:426)
        at
        jeeves.server.JeevesEngine.loadConfigFile(JeevesEngine.java:268)
        at jeeves.server.JeevesEngine.init(JeevesEngine.java:146)
        at
        jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:74)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at
        org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
        at
        org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
        at
        org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)

...

2012-09-13 19:18:36,458 INFO [jeeves.engine] - --- Starting handler
--------------------------------------
2012-09-13 19:18:36,459 INFO [jeeves.apphand] - Initializing
GeoNetwork 2.6.4.SNAPSHOT ...
2012-09-13 19:18:36,614 INFO [jeeves.apphand] - Failed to open
database connection, Check config.xml db file configuration.Error
is:
null
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Raised exception
while starting appl handler. Skipped.
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Handler :
org.fao.geonet.Geonetwork
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Exception :
java.lang.NullPointerException
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Message : null
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Stack :
java.lang.NullPointerException
        at
        org.fao.geonet.Geonetwork.initDatabase(Geonetwork.java:405)
        at org.fao.geonet.Geonetwork.start(Geonetwork.java:131)
        at
        jeeves.server.JeevesEngine.initAppHandler(JeevesEngine.java:475)
        at jeeves.server.JeevesEngine.init(JeevesEngine.java:155)
        at
        jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:74)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at
        org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
        at
        org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
        at
        org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
        at
        org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
        at
        org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at
        org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        at
        org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        at
        org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
        at
        org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)

Here is a list of JDBC drivers in my GN installation:

/WEB-INF/lib
...
-rw-r--r-- 1 tomcat6 tomcat6 12121 Mar 3 2010
postgis-driver-1.0.jar
-rw-r--r-- 1 tomcat6 tomcat6 472831 Mar 3 2010
postgresql-8.4-701.jdbc3.jar

/usr/share/tomcat6/lib
...
lrwxrwxrwx 1 root root 22 Aug 22 15:20
/usr/share/tomcat6/lib/postgis.jar -> ../../java/postgis.jar
lrwxrwxrwx 1 root root 31 Aug 22 18:50
/usr/share/tomcat6/lib/postgresql-jdbc3.jar ->
../../java/postgresql-jdbc3.jar

Cheers
Richard Goh

-----Original Message-----
From: Jørn Vegard Røsnes [mailto:jorn@anonymised.com]
Sent: Thursday, 13 September 2012 5:08 PM
To: Goh, Richard (CESRE, Kensington)
Cc: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial
features in Geonetwork 2.6.4?

Hi,

here is our config.xml for PostGIS.

<resource enabled="true">
    <name>main-db</name>
    <provider>jeeves.resources.dbms.DbmsPool</provider>
    <config>
      <user>geonetwork</user>
      <password>pw</password>
      <driver>org.postgresql.Driver</driver>
      <url>jdbc:postgis://localhost:5432/geonetwork</url>
      <poolSize>10</poolSize>
    </config>
</resource>

In the database we have entries in the spatialindex table and I can't
find errors in the log file.

Please note:
- enabled="true", must be set enabled="false" for the other
db-resource-entries in config.xml
- short-versions of resource/config/url in xml seems to fail (often),
long-version with port-number works.
Short-versions tested:
jdbc:postgresql:database
jdbc:postgresql://host/database
ref. http://www.petefreitag.com/articles/jdbc_urls/

kind regards
Jørn-Vegard Røsnes

----- Original Message -----
> Fra: "Richard Goh" <Richard.Goh@anonymised.com>
> Til: "jose garcia" <jose.garcia@anonymised.com>
> Kopi: geonetwork-users@lists.sourceforge.net
> Sendt: 13. september 2012 10:11:57
> Emne: Re: [GeoNetwork-users] How to enable PostGIS spatial features
> in Geonetwork 2.6.4?
>
> Hi Jose,
>
> Many thanks for your quick response.
>
> I changed the connection string to lowercase and the database
> connection failed. See error log below:
>
> 2012-09-13 18:01:55,135 INFO [jeeves.engine] - --- Starting
> handler
> --------------------------------------
> 2012-09-13 18:01:55,136 INFO [jeeves.apphand] - Initializing
> GeoNetwork 2.6.4.SNAPSHOT ...
> 2012-09-13 18:01:55,326 INFO [jeeves.apphand] - Failed to open
> database connection, Check config.xml db file configuration.Error
> is:
> null
> 2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Raised exception
> while
> starting appl handler. Skipped.
> 2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Handler :
> org.fao.geonet.Geonetwork
> 2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Exception :
> java.lang.NullPointerException
> 2012-09-13 18:01:55,327 ERROR [jeeves.engine] - Message : null
> 2012-09-13 18:01:55,327 ERROR [jeeves.engine] - Stack :
> java.lang.NullPointerException
> at
> org.fao.geonet.Geonetwork.initDatabase(Geonetwork.java:405)
> at org.fao.geonet.Geonetwork.start(Geonetwork.java:131)
> at
> jeeves.server.JeevesEngine.initAppHandler(JeevesEngine.java:475)
> at jeeves.server.JeevesEngine.init(JeevesEngine.java:155)
> at
> jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:74)
> at
> javax.servlet.GenericServlet.init(GenericServlet.java:212)
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
> at
>
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja
>
> If the postgis needs to be in lowercase then the code will need to
> be
> fixed unless there is a workaround.
>
> Cheers
> Richard Goh
>
> From: Jose Garcia [mailto:jose.garcia@anonymised.com]
> Sent: Thursday, 13 September 2012 3:59 PM
> To: Goh, Richard (CESRE, Kensington)
> Cc: geonetwork-users@lists.sourceforge.net
> Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial
> features
> in Geonetwork 2.6.4?
>
> Hi Richard
>
> From log file, it's using shapefile. I'll try to test tonight about
> the connection string. In GeoNetwork 2.6.4 code is used this
> comparison to use PostGis jdbc driver:
>
> if (url.contains("postgis")) {
>
> I think at some moment was used jdbc:postgis:... , but maybe I'm
> wrong
> or was changed later to postgres_postgis. Anyway, the check in Java
> code seem requires at least postgis written in lowercase in
> connection
> string (postgresql_postgis).
>
> Regards,
> Jose García
>
> On Thu, Sep 13, 2012 at 9:50 AM,
> <Richard.Goh@anonymised.com<mailto:Richard.Goh@anonymised.com>> wrote:
> Hi Jose,
>
> Thanks for explaining how the spatial indexing is used in
> Geonetwork.
>
> The postgis JDBC string didn’t work. My Geonetwork instance failed
> to
> start with that JDBC string.
>
> So I changed it back again to postgresql_postGIS and restarted the
> tomcat server.
>
> I noticed the following in the geonetwork log file:
>
> ...
> 2012-09-13 17:22:45,061 INFO [jeeves.apphand] - Server is
> Enabled.
> 2012-09-13 17:22:45,063 INFO [jeeves.apphand] - - Search...
> 2012-09-13 17:22:45,063 INFO [jeeves.apphand] - Using shapefile
> /usr/local/geonetwork/WEB-INF/lucene/spatial/spatialindex.shp
> 2012-09-13 17:22:45,072 DEBUG
> [org.jzkit.z3950.server.Z3950Listener]
> - Starting ZServer on port 2100 (timeout=300000)
> 2012-09-13 17:22:45,079 DEBUG
> [org.jzkit.z3950.server.Z3950Listener]
> - Waiting for connection
> 2012-09-13 17:22:46,665 INFO [jeeves.apphand] - NOTE: Using
> shapefile
> for spatial index, this can be slow for larger catalogs
> 2012-09-13 17:22:46,745 DEBUG [geonetwork.stopwordparser] -
> StopwordParser parsing file:
> /usr/local/geonetwork/resources/stopwords/english_stop.txt
> ...
>
> So I then searched for the datastore creation failure message but I
> couldn’t find any in the log neither the ‘Using the POSTGIS for
> spatial index’ message.
>
> 2012-09-13 17:22:41,639 INFO [jeeves.engine] - Initializing
> profiles...
> 2012-09-13 17:22:41,671 INFO [jeeves.engine] - Found handler :
> org.fao.geonet.Geonetwork
> 2012-09-13 17:22:41,706 INFO [jeeves.engine] - --- Starting
> handler
> --------------------------------------
> 2012-09-13 17:22:41,715 INFO [jeeves.apphand] - Initializing
> GeoNetwork 2.6.4.SNAPSHOT ...
> 2012-09-13 17:22:41,916 INFO [jeeves.apphand] - - Database
> connection on jdbc:postgresql_postGIS://<host>:5432/geonetwork ...
> 2012-09-13 17:22:41,985 INFO [jeeves.apphand] - Found an
> existing GeoNetwork database.
> 2012-09-13 17:22:41,985 INFO [jeeves.apphand] - - Setting
> manager...
> 2012-09-13 17:22:42,043 INFO [jeeves.apphand] - - Migration ...
> 2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Webapp
> version:2.6.4 subversion:SNAPSHOT
> 2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Database
> version:2.6.4 subversion:0
> 2012-09-13 17:22:42,044 INFO [jeeves.apphand] - Webapp
> version
> = Database version, no migration task to apply.
> 2012-09-13 17:22:42,044 INFO [jeeves.apphand] - - Thesaurus...
> 2012-09-13 17:22:42,448 DEBUG [geonetwork.thesaurus-man] - Adding
> thesaurus : external.place.regions
> 2012-09-13 17:22:43,015 DEBUG [geonetwork.thesaurus-man] - Adding
> thesaurus : external.theme.inspire-theme
> 2012-09-13 17:22:43,141 INFO [jeeves.apphand] - - Z39.50...
> 2012-09-13 17:22:43,199 INFO [jeeves.apphand] - Repositories
> file built from template.
> 2012-09-13 17:22:44,275 DEBUG
> [org.jzkit.search.util.RecordBuilder.RecordBuilderService] - new
> RecordBuilderService
> 2012-09-13 17:22:44,282 DEBUG
> [org.jzkit.search.util.RecordBuilder.RecordBuilderService] -
> RecordBuilderService::init
> 2012-09-13 17:22:44,665 DEBUG
> [org.jzkit.z3950.server.Z3950Listener]
> - new Z3950Listener()
> 2012-09-13 17:22:44,676 DEBUG
> [org.jzkit.service.z3950server.JZKitBackend] - New JZKitBackend
> 1752161445
> 2012-09-13 17:22:44,702 DEBUG
> [org.jzkit.configuration.provider.xml.InMemoryImpl] -
> setApplicationContext...
> 2012-09-13 17:22:44,702 DEBUG
> [org.jzkit.configuration.provider.xml.InMemoryImpl] - Load config:
> /JZKitConfig.xml
> 2012-09-13 17:22:44,704 DEBUG
> [org.jzkit.configuration.provider.xml.InMemoryImpl] - Loading rules
> : jar:file:/usr/local/geonetwork/WEB-IN
> F/lib/jzkit-service-3.r260.geonetwork.patch.1.jar!/org/jzkit/configura
> tion/provider/xml/DigesterRules.xml
> 2012-09-13 17:22:44,753 DEBUG
> [org.jzkit.configuration.provider.xml.InMemoryImpl] - Parsing
> config
> 2012-09-13 17:22:44,754 DEBUG
> [org.jzkit.configuration.provider.xml.InMemoryImpl] -
> registerClasspathProfile : profiles/geo.xml (ctx=org.
> springframework.context.support.ClassPathXmlApplicationContext@anonymised.com..<mailto:springframework.context.support.ClassPathXmlApplicationContext@anonymised.com.1154…>:
> display name [org.springframework.context.support.ClassPathXmlAp
> plicationContext@anonymised.com]; startup date [Thu Sep 13 17:22:43 EST
> 2012]; root of context hierarchy)
>
> Cheers
> Richard Goh
> ----------------------------------------------------------------------
> --------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond.
> Discussions
> will include endpoint security, mobile security and the latest in
> malware threats.
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> GeoNetwork-users mailing list
> GeoNetwork-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at
> http://sourceforge.net/projects/geonetwork
>

CONFIDENTIALITY
This e-mail and any attachment contain KONGSBERG information which
may be proprietary, confidential or subject to export regulations,
and is only meant for the intended recipient(s). Any disclosure,
copying, distribution or use is prohibited, if not otherwise
explicitly agreed with KONGSBERG. If received in error, please
delete it immediately from your system and notify the sender
properly.

CONFIDENTIALITY
This e-mail and any attachment contain KONGSBERG information which may be
proprietary, confidential or subject to export regulations, and is only meant
for the intended recipient(s). Any disclosure, copying, distribution or use is
prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in
error, please delete it immediately from your system and notify the sender
properly.

Well done Jørn! & also Jose.

It finally works for me now and I can see the spatialindex table is being populated with data now.

My geonetwork log also indicated it is using PostGIS spatial index:

2012-09-13 19:55:39,740 DEBUG [org.jzkit.z3950.server.Z3950Listener] - Starting ZServer on port 2100 (timeout=300000)
2012-09-13 19:55:39,740 DEBUG [org.jzkit.z3950.server.Z3950Listener] - Waiting for connection
2012-09-13 19:55:39,970 INFO [jeeves.apphand] - NOTE: Using POSTGIS for spatial index

I'm impressed with the promptness of this user community. Well done everyone and a BIG thanks for solving my spatial indexing issue.

-----Original Message-----
From: Jørn Vegard Røsnes [mailto:jorn@…272…]
Sent: Thursday, 13 September 2012 5:49 PM
To: Goh, Richard (CESRE, Kensington)
Cc: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi,

the error message:
The class class org.postgis.PGbox2d does not implement org.postgresql.util.PGobject indicates a jar conflict.
https://www.google.no/search?q=The+class+class+org.postgis.PGbox2d+does+not+implement+org.postgresql.util.PGobject

I would suggest to move these elsewhere (remove soft links?):
/usr/share/tomcat6/lib
lrwxrwxrwx 1 root root 22 Aug 22 15:20 /usr/share/tomcat6/lib/postgis.jar -> ../../java/postgis.jar lrwxrwxrwx 1 root root 31 Aug 22 18:50 /usr/share/tomcat6/lib/postgresql-jdbc3.jar -> ../../java/postgresql-jdbc3.jar

vennlig hilsen
Jørn-Vegard Røsnes

----- Original Message -----

Fra: "Richard Goh" <Richard.Goh@...448...>
Til: jorn@...272...
Kopi: geonetwork-users@lists.sourceforge.net
Sendt: 13. september 2012 11:33:57
Emne: RE: [GeoNetwork-users] How to enable PostGIS spatial features in Geonetwork 2.6.4?

Hi Jørn,

Thanks for your email.

I tried your database configuration and the database connection still
failed.

However, I got more error now in geonetwork log file.

Here is the error log:

2012-09-13 19:12:54,872 INFO [jeeves.engine] - Initializing
resources...
2012-09-13 19:12:54,873 INFO [jeeves.engine] - Adding resource :
main-db
2012-09-13 19:12:54,981 ERROR [jeeves.engine] - Raised exception while
initializing resource. Skipped.
2012-09-13 19:12:54,982 ERROR [jeeves.engine] - Resource :
main-db
2012-09-13 19:12:54,982 ERROR [jeeves.engine] - Provider :
jeeves.resources.dbms.DbmsPool
2012-09-13 19:12:54,982 ERROR [jeeves.engine] - Exception :
org.postgresql.util.PSQLException: The class class org.postgis.PGbox2d
does not implement org.postgresql.util.PGobject.
2012-09-13 19:12:54,982 ERROR [jeeves.engine] - Message : The
class class org.postgis.PGbox2d does not implement
org.postgresql.util.PGobject.
2012-09-13 19:12:54,983 ERROR [jeeves.engine] - Stack :
org.postgresql.util.PSQLException: The class class org.postgis.PGbox2d
does not implement org.postgresql.util.PGobject.
        at
        org.postgresql.jdbc2.TypeInfoCache.addDataType(TypeInfoCache.java:163)
        at
        org.postgresql.jdbc2.AbstractJdbc2Connection.addDataType(AbstractJdbc2Connection.java:482)
        at
        org.postgresql.jdbc2.AbstractJdbc2Connection.initObjectTypes(AbstractJdbc2Connection.java:519)
        at
        org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:172)
        at
        org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
        at
        org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
        at org.postgresql.Driver.makeConnection(Driver.java:393)
        at org.postgresql.Driver.connect(Driver.java:267)
        at
        java.sql.DriverManager.getConnection(DriverManager.java:582)
        at
        java.sql.DriverManager.getConnection(DriverManager.java:185)
        at jeeves.resources.dbms.Dbms.connect(Dbms.java:88)
        at jeeves.resources.dbms.DbmsPool.init(DbmsPool.java:90)
        at
        jeeves.server.resources.ProviderManager.register(ProviderManager.java:54)
        at
        jeeves.server.JeevesEngine.initResources(JeevesEngine.java:426)
        at
        jeeves.server.JeevesEngine.loadConfigFile(JeevesEngine.java:268)
        at jeeves.server.JeevesEngine.init(JeevesEngine.java:146)
        at
        jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:74)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at
        org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
        at
        org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
        at

org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext
.java:4421)

...

2012-09-13 19:18:36,458 INFO [jeeves.engine] - --- Starting handler
--------------------------------------
2012-09-13 19:18:36,459 INFO [jeeves.apphand] - Initializing
GeoNetwork 2.6.4.SNAPSHOT ...
2012-09-13 19:18:36,614 INFO [jeeves.apphand] - Failed to open
database connection, Check config.xml db file configuration.Error
is:
null
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Raised exception while
starting appl handler. Skipped.
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Handler :
org.fao.geonet.Geonetwork
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Exception :
java.lang.NullPointerException
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Message : null
2012-09-13 19:18:36,615 ERROR [jeeves.engine] - Stack :
java.lang.NullPointerException
        at
        org.fao.geonet.Geonetwork.initDatabase(Geonetwork.java:405)
        at org.fao.geonet.Geonetwork.start(Geonetwork.java:131)
        at
        jeeves.server.JeevesEngine.initAppHandler(JeevesEngine.java:475)
        at jeeves.server.JeevesEngine.init(JeevesEngine.java:155)
        at
        jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:74)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at
        org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
        at
        org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
        at
        org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
        at
        org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
        at
        org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at
        org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        at
        org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        at
        org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
        at

org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.ja
va:601)

Here is a list of JDBC drivers in my GN installation:

/WEB-INF/lib
...
-rw-r--r-- 1 tomcat6 tomcat6 12121 Mar 3 2010
postgis-driver-1.0.jar
-rw-r--r-- 1 tomcat6 tomcat6 472831 Mar 3 2010
postgresql-8.4-701.jdbc3.jar

/usr/share/tomcat6/lib
...
lrwxrwxrwx 1 root root 22 Aug 22 15:20
/usr/share/tomcat6/lib/postgis.jar -> ../../java/postgis.jar
lrwxrwxrwx 1 root root 31 Aug 22 18:50
/usr/share/tomcat6/lib/postgresql-jdbc3.jar ->
../../java/postgresql-jdbc3.jar

Cheers
Richard Goh

-----Original Message-----
From: Jørn Vegard Røsnes [mailto:jorn@…272…]
Sent: Thursday, 13 September 2012 5:08 PM
To: Goh, Richard (CESRE, Kensington)
Cc: geonetwork-users@lists.sourceforge.net
Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial features
in Geonetwork 2.6.4?

Hi,

here is our config.xml for PostGIS.

<resource enabled="true">
    <name>main-db</name>
    <provider>jeeves.resources.dbms.DbmsPool</provider>
    <config>
      <user>geonetwork</user>
      <password>pw</password>
      <driver>org.postgresql.Driver</driver>
      <url>jdbc:postgis://localhost:5432/geonetwork</url>
      <poolSize>10</poolSize>
    </config>
</resource>

In the database we have entries in the spatialindex table and I can't
find errors in the log file.

Please note:
- enabled="true", must be set enabled="false" for the other
db-resource-entries in config.xml
- short-versions of resource/config/url in xml seems to fail (often),
long-version with port-number works.
Short-versions tested:
jdbc:postgresql:database
jdbc:postgresql://host/database
ref. http://www.petefreitag.com/articles/jdbc_urls/

kind regards
Jørn-Vegard Røsnes

----- Original Message -----
> Fra: "Richard Goh" <Richard.Goh@...448...>
> Til: "jose garcia" <jose.garcia@...444...>
> Kopi: geonetwork-users@lists.sourceforge.net
> Sendt: 13. september 2012 10:11:57
> Emne: Re: [GeoNetwork-users] How to enable PostGIS spatial features
> in Geonetwork 2.6.4?
>
> Hi Jose,
>
> Many thanks for your quick response.
>
> I changed the connection string to lowercase and the database
> connection failed. See error log below:
>
> 2012-09-13 18:01:55,135 INFO [jeeves.engine] - --- Starting handler
> --------------------------------------
> 2012-09-13 18:01:55,136 INFO [jeeves.apphand] - Initializing
> GeoNetwork 2.6.4.SNAPSHOT ...
> 2012-09-13 18:01:55,326 INFO [jeeves.apphand] - Failed to open
> database connection, Check config.xml db file configuration.Error
> is:
> null
> 2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Raised exception
> while starting appl handler. Skipped.
> 2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Handler :
> org.fao.geonet.Geonetwork
> 2012-09-13 18:01:55,326 ERROR [jeeves.engine] - Exception :
> java.lang.NullPointerException
> 2012-09-13 18:01:55,327 ERROR [jeeves.engine] - Message : null
> 2012-09-13 18:01:55,327 ERROR [jeeves.engine] - Stack :
> java.lang.NullPointerException
> at
> org.fao.geonet.Geonetwork.initDatabase(Geonetwork.java:405)
> at org.fao.geonet.Geonetwork.start(Geonetwork.java:131)
> at
> jeeves.server.JeevesEngine.initAppHandler(JeevesEngine.java:475)
> at jeeves.server.JeevesEngine.init(JeevesEngine.java:155)
> at
> jeeves.server.sources.http.JeevesServlet.init(JeevesServlet.java:74)
> at
> javax.servlet.GenericServlet.init(GenericServlet.java:212)
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
> at
>
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.j
> a
>
> If the postgis needs to be in lowercase then the code will need to
> be fixed unless there is a workaround.
>
> Cheers
> Richard Goh
>
> From: Jose Garcia [mailto:jose.garcia@…444…]
> Sent: Thursday, 13 September 2012 3:59 PM
> To: Goh, Richard (CESRE, Kensington)
> Cc: geonetwork-users@lists.sourceforge.net
> Subject: Re: [GeoNetwork-users] How to enable PostGIS spatial
> features in Geonetwork 2.6.4?
>
> Hi Richard
>
> From log file, it's using shapefile. I'll try to test tonight about
> the connection string. In GeoNetwork 2.6.4 code is used this
> comparison to use PostGis jdbc driver:
>
> if (url.contains("postgis")) {
>
> I think at some moment was used jdbc:postgis:... , but maybe I'm
> wrong or was changed later to postgres_postgis. Anyway, the check in
> Java code seem requires at least postgis written in lowercase in
> connection string (postgresql_postgis).
>
> Regards,
> Jose García
>
> On Thu, Sep 13, 2012 at 9:50 AM,
> <Richard.Goh@...448...<mailto:Richard.Goh@…448…>> wrote:
> Hi Jose,
>
> Thanks for explaining how the spatial indexing is used in
> Geonetwork.
>
> The postgis JDBC string didn’t work. My Geonetwork instance failed
> to start with that JDBC string.
>
> So I changed it back again to postgresql_postGIS and restarted the
> tomcat server.
>
> I noticed the following in the geonetwork log file:
>
> ...
> 2012-09-13 17:22:45,061 INFO [jeeves.apphand] - Server is
> Enabled.
> 2012-09-13 17:22:45,063 INFO [jeeves.apphand] - - Search...
> 2012-09-13 17:22:45,063 INFO [jeeves.apphand] - Using shapefile
> /usr/local/geonetwork/WEB-INF/lucene/spatial/spatialindex.shp
> 2012-09-13 17:22:45,072 DEBUG
> [org.jzkit.z3950.server.Z3950Listener]
> - Starting ZServer on port 2100 (timeout=300000)
> 2012-09-13 17:22:45,079 DEBUG
> [org.jzkit.z3950.server.Z3950Listener]
> - Waiting for connection
> 2012-09-13 17:22:46,665 INFO [jeeves.apphand] - NOTE: Using
> shapefile for spatial index, this can be slow for larger catalogs
> 2012-09-13 17:22:46,745 DEBUG [geonetwork.stopwordparser] -
> StopwordParser parsing file:
> /usr/local/geonetwork/resources/stopwords/english_stop.txt
> ...
>
> So I then searched for the datastore creation failure message but I
> couldn’t find any in the log neither the ‘Using the POSTGIS for
> spatial index’ message.
>
> 2012-09-13 17:22:41,639 INFO [jeeves.engine] - Initializing
> profiles...
> 2012-09-13 17:22:41,671 INFO [jeeves.engine] - Found handler :
> org.fao.geonet.Geonetwork
> 2012-09-13 17:22:41,706 INFO [jeeves.engine] - --- Starting handler
> --------------------------------------
> 2012-09-13 17:22:41,715 INFO [jeeves.apphand] - Initializing
> GeoNetwork 2.6.4.SNAPSHOT ...
> 2012-09-13 17:22:41,916 INFO [jeeves.apphand] - - Database
> connection on jdbc:postgresql_postGIS://<host>:5432/geonetwork ...
> 2012-09-13 17:22:41,985 INFO [jeeves.apphand] - Found an
> existing GeoNetwork database.
> 2012-09-13 17:22:41,985 INFO [jeeves.apphand] - - Setting
> manager...
> 2012-09-13 17:22:42,043 INFO [jeeves.apphand] - - Migration ...
> 2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Webapp
> version:2.6.4 subversion:SNAPSHOT
> 2012-09-13 17:22:42,044 DEBUG [jeeves.apphand] - Database
> version:2.6.4 subversion:0
> 2012-09-13 17:22:42,044 INFO [jeeves.apphand] - Webapp
> version
> = Database version, no migration task to apply.
> 2012-09-13 17:22:42,044 INFO [jeeves.apphand] - - Thesaurus...
> 2012-09-13 17:22:42,448 DEBUG [geonetwork.thesaurus-man] - Adding
> thesaurus : external.place.regions
> 2012-09-13 17:22:43,015 DEBUG [geonetwork.thesaurus-man] - Adding
> thesaurus : external.theme.inspire-theme
> 2012-09-13 17:22:43,141 INFO [jeeves.apphand] - - Z39.50...
> 2012-09-13 17:22:43,199 INFO [jeeves.apphand] - Repositories
> file built from template.
> 2012-09-13 17:22:44,275 DEBUG
> [org.jzkit.search.util.RecordBuilder.RecordBuilderService] - new
> RecordBuilderService
> 2012-09-13 17:22:44,282 DEBUG
> [org.jzkit.search.util.RecordBuilder.RecordBuilderService] -
> RecordBuilderService::init
> 2012-09-13 17:22:44,665 DEBUG
> [org.jzkit.z3950.server.Z3950Listener]
> - new Z3950Listener()
> 2012-09-13 17:22:44,676 DEBUG
> [org.jzkit.service.z3950server.JZKitBackend] - New JZKitBackend
> 1752161445
> 2012-09-13 17:22:44,702 DEBUG
> [org.jzkit.configuration.provider.xml.InMemoryImpl] -
> setApplicationContext...
> 2012-09-13 17:22:44,702 DEBUG
> [org.jzkit.configuration.provider.xml.InMemoryImpl] - Load config:
> /JZKitConfig.xml
> 2012-09-13 17:22:44,704 DEBUG
> [org.jzkit.configuration.provider.xml.InMemoryImpl] - Loading rules
> : jar:file:/usr/local/geonetwork/WEB-IN
> F/lib/jzkit-service-3.r260.geonetwork.patch.1.jar!/org/jzkit/configu
> ra
> tion/provider/xml/DigesterRules.xml
> 2012-09-13 17:22:44,753 DEBUG
> [org.jzkit.configuration.provider.xml.InMemoryImpl] - Parsing config
> 2012-09-13 17:22:44,754 DEBUG
> [org.jzkit.configuration.provider.xml.InMemoryImpl] -
> registerClasspathProfile : profiles/geo.xml (ctx=org.
> springframework.context.support.ClassPathXmlApplicationContext@...1154...<mailto:springframework.context.support.ClassPathXmlApplicationContext@…1154…>:
> display name [org.springframework.context.support.ClassPathXmlAp
> plicationContext@...1154...]; startup date [Thu Sep 13 17:22:43 EST
> 2012]; root of context hierarchy)
>
> Cheers
> Richard Goh
> --------------------------------------------------------------------
> --
> --------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond.
> Discussions
> will include endpoint security, mobile security and the latest in
> malware threats.
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> GeoNetwork-users mailing list
> GeoNetwork-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at
> http://sourceforge.net/projects/geonetwork
>

CONFIDENTIALITY
This e-mail and any attachment contain KONGSBERG information which may
be proprietary, confidential or subject to export regulations, and is
only meant for the intended recipient(s). Any disclosure, copying,
distribution or use is prohibited, if not otherwise explicitly agreed
with KONGSBERG. If received in error, please delete it immediately
from your system and notify the sender properly.

CONFIDENTIALITY
This e-mail and any attachment contain KONGSBERG information which may be proprietary, confidential or subject to export regulations, and is only meant for the intended recipient(s). Any disclosure, copying, distribution or use is prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in error, please delete it immediately from your system and notify the sender properly.