[GeoNetwork-users] PostGis spatialindex not working when the schema is different than "public"

Hello,

Hi have the next environment:
- GN 2.6.4 + PostGreSQL 9.0.4-1 + PostGis 1.5.2-3.
- PostGis Database with a new schema (not the "public" schema) to hold GN
database.

Problem: When starting GN I get this error:

org.geotools.data.SchemaNotFoundException: Feature type could not be found
for spatialindex
        at
org.geotools.data.jdbc.fidmapper.DefaultFIDMapperFactory.getPkColumnInfo(DefaultFIDMapperFactory.java:297)
        at
org.geotools.data.jdbc.fidmapper.DefaultFIDMapperFactory.getMapper(DefaultFIDMapperFactory.java:115)
        at
org.geotools.data.postgis.PostgisDataStore.buildFIDMapper(PostgisDataStore.java:1022)
        at
org.geotools.data.jdbc.FeatureTypeHandler.getFIDMapper(FeatureTypeHandler.java:231)
        at
org.geotools.data.postgis.PostgisDataStore.getFeatureSource(PostgisDataStore.java:1667)
        at
org.fao.geonet.kernel.search.spatial.SpatialIndexWriter.createFeatureStore(SpatialIndexWriter.java:360)
        at
org.fao.geonet.kernel.search.spatial.SpatialIndexWriter.<init>(SpatialIndexWriter.java:103)
        at
org.fao.geonet.kernel.search.SearchManager$Spatial.writerNoLocking(SearchManager.java:1280)
        at
org.fao.geonet.kernel.search.SearchManager$Spatial.writer(SearchManager.java:1266)
        at
org.fao.geonet.kernel.search.SearchManager.deleteGroup(SearchManager.java:538)
        at
org.fao.geonet.kernel.search.SearchManager.buildIndexDocument(SearchManager.java:558)
        at
org.fao.geonet.kernel.search.SearchManager.indexGroup(SearchManager.java:510)
        at
org.fao.geonet.kernel.DataManager.indexMetadataI(DataManager.java:396)
        at
org.fao.geonet.kernel.DataManager.indexMetadata(DataManager.java:298)
        at
org.fao.geonet.kernel.DataManager.indexMetadataGroup(DataManager.java:282)
        at
org.fao.geonet.kernel.DataManager$IndexMetadataTask.run(DataManager.java:240)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)Exception in thread
"Timer-1" java.lang.NullPointerException
        at
org.fao.geonet.kernel.search.SearchManager$Spatial$Committer.run(SearchManager.java:1311)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)

Maybe this error is generated because the spatialindex table is expected in
the "public" schema instead of my schema.

In Geonetwork.java class, line 542 DataStore ds =
factory.createDataStore(params) of the method createPostgisDatastore is not
passing the schema name in the params parameter, therefore, the geotools
method createDataStore in the PostGisDataStoreFactory.java class defaults to
the "public" schema. I think that maybe this is the reason that Geonetwork
is not finding the spatialindex table during execution.

To solve that problem, I changed the GN configuration to Postgres instead of
PostGis.

I'm not sure if I'll get more problems with GN if I work with a schema
diferent from the "public" one. Can anyone give some advice about this?
Should I continue with this configuration (PostGres + schema different than
"public") or should I use the "public" schema to get GN run properly?

Thanks in advance and best regards,
Montse Marco

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/PostGis-spatialindex-not-working-when-the-schema-is-different-than-public-tp6418468p6418468.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Hi Mabel,

What I mean with changing Postgis to Postgres is that I tell to Geonetwork
during configuration time that my database is PostGres in order to
Geonetwork creates the /WEB-INF/lucene/spatial/spatialindex.shp instead of
the PostGis 'spatialindex' table. Working with PostGres (although the
database has installed the Postgis plug-in) solved the problem.

Hope it helps,

Best regads,
Montse

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/PostGis-spatialindex-not-working-when-the-schema-is-different-than-public-tp6418468p6520413.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.