|
From: Sylvie F. <syl...@ir...> - 2012-11-26 07:28:45
|
Dear Simon, Thank you for your help, I was missing postgis jar in tomcat lib (this might be the missing part in the doc), now geonetwork seems to be using postgis (log file indicating so) but I still have the error: "The metadata document index with id=7 is corrupt/invalid - ignoring it. Error: org.geotools.jdbc.JDBCFeatureSource cannot be cast to org.geotools.data.FeatureStore" I tried to recreate databasewithout effect, first metadata created is throwing this error and then I have "Timer is already cancelled". Maybe am I missing lucene librairies somewhere ? Cheers, Sylvie On 11/24/2012 11:14 AM, Sim...@cs... wrote: > Hi Sylvie, > > Not sure what is going on but to check the config steps I set it up using the latest 2.8.x build: > > - place postgresql and postgis jdbc driver jars in your tomcat lib dir (tomcat6) > - place commons-dbcp-1.3.jar and commons-pool-1.5.5.jar in your tomcat lib dir (tomcat6 again) > - configure your tomcat/conf/context.xml something like the following: > > <Resource name="jdbc/geonetwork" > auth="Container" > type="javax.sql.DataSource" > username="dbusername" > password="dbpassword" > driverClassName="org.postgis.DriverWrapper" > factory="org.apache.commons.dbcp.BasicDataSourceFactory" > url="jdbc:postgresql_postGIS://localhost:5432/gndb4" > maxActive="10" > maxIdle="10" > removeAbandoned="true" > removeAbandonedTimeout="3600" > logAbandoned="true" > testOnBorrow="true" > defaultAutoCommit="false" > defaultTransactionIsolation="READ_COMMITTED" > accessToUnderlyingConnectionAllowed="true" > validationQuery="select 1"/> > > - then in webapps/geonetwork/WEB-INF/config.xml you should have: > > <resource enabled="true"> > <name>main-db</name> > <provider>jeeves.resources.dbms.JNDIPool</provider> > <config> > <context>java:/comp/env</context> > <resourceName>jdbc/geonetwork</resourceName> > <url>jdbc:postgresql_postGIS://localhost:5432/gndb</url> > <!-- if the database has a spatialindex table with fid, id and > multipolygon geometry fields (eg. see postgis) then specify true > here and GeoNetwork will use the database for its spatial index > otherwise specify false or leave the parameter out and a > shapefile will be used for the spatial index --> > <provideDataStore>true</provideDataStore> > <!-- set this value to -1 if you don't want prepared statements to > be cached when querying/maintaining the spatial index > (note this is only applicable when > provideDataStore is set to true) --> > <maxOpenPreparedStatements>300</maxOpenPreparedStatements> > <!-- NOTE any other parameter specified here is ignored as this > should be handled in the container --> > </config> > </resource> > > In your logs/catalina.log file you should see things like: > > 2012-11-24 11:02:26,922 INFO [jeeves.apphand] - - Database connection on jdbc:postgresql_postGIS://localhost:5432/gndb4 ... > 2012-11-24 11:02:26,940 INFO [jeeves.apphand] - jdbc:postgresql_postGIS://localhost:5432/gndb4 is an empty database (Metadata table not found). > 2012-11-24 11:02:26,940 INFO [jeeves.apphand] - - SQL create file:/usr/local/jakarta/tomcat-geonetwork/webapps/geonetwork/WEB-INF/classes/setup/sql/create prefix:create-db- ... > .... > > indicating a successful connection to the database and creation of tables needed by GeoNetwork. > > These steps should be described in the documentation at http://geonetwork-opensource.org/manuals/trunk/eng/users/admin/advanced-configuration/index.html#database-connection-pool-managed-by-the-container but maybe there are things that are not clear (it does use an oracle example. maybe it should have a postgis example too?) so if we can sort this out perhaps we can include steps in there to make sure this doesn't occur for others. > > Cheers and thanks, > Simon > ________________________________________ > From: Sylvie Fiat [syl...@ir...] > Sent: Thursday, 22 November 2012 10:55 AM > To: geo...@li... > Subject: Re: [GeoNetwork-users] Cannot find metadata - Lucene or postgres error ? > > Hello list, > > Any ideas ? > > Maybe I am posting on the wrong list (developer instead ?) ? > > I changed the version with 2.8 RC 2 but still got the same problem with > lucene not working and metadatas/templates being throwing errors: > "The metadata document index with id=7 is corrupt/invalid - ignoring it. > Error: org.geotools.jdbc.JDBCFeatureSource cannot be cast to > org.geotools.data.FeatureStore" > > > Thanks, > Sylvie > > On 11/09/2012 06:16 PM, Sylvie Fiat wrote: >> Hi, >> >> I just installed last version of GeoNetwork 2.8 on Linux with tomcat >> using postgres/postgis with JNDI configuration, using >> geonetwork-branch28-2012-11-07.war >> <http://nightlybuild.geonetwork-opensource.org/28branch/geonetwork-branch28-2012-11-07.war>. >> >> I tried to add templates iso19139 using Administration page and after >> confirmation tried to add New metadata but I get "No templates >> available, import metadata first.". >> >> I also tried to import a metadata file in iso19139 which worked well as >> I could edit and view it (even passed to status Approved) but cannot get >> it when searching My metadata (or normal search) I can only find it when >> "searching for unused". >> >> In the metadata table in postgres I have the records there including the >> templates and the metadata file. >> >> When starting tomcat, I have : >> "Failure to make _writer, maybe a problem but might also not be an >> issue:<error id="error"> >> <message>org.geotools.jdbc.JDBCFeatureSource cannot be cast to >> org.geotools.data.FeatureStore</message> >> <class>ClassCastException</class>" >> and then >> "2012-11-09 15:12:32,714 ERROR [geonetwork.spatial] - Unable to call >> reset on Spatial writer: null >> 2012-11-09 15:12:32,722 ERROR [geonetwork.index] - Rebuilding lucene index" >> >> Then every metadata is ignored with error: >> "The metadata document index with id=4 is corrupt/invalid - ignoring it. >> Error: org.geotools.jdbc.JDBCFeatureSource cannot be cast to >> org.geotools.data.FeatureStore" >> >> Finally when I try to rebuild index I have a popup saying "Index >> operation already in progress please wait". >> >> I checked database configuration many times and have look through all >> the forum and mailing list I could but I can't figure out what is going >> wrong. >> >> The spatialindex table is empty in postgres, but I am not sure if it >> could be the issue as templates might not use it maybe my metadata file ? >> >> What I am missing ? >> >> I can provide the log file if needed. >> >> Thanks in advance, >> >> Sylvie >> >> <http://nightlybuild.geonetwork-opensource.org/28branch/geonetwork-branch28-2012-11-07.war> >> >> > -- > Sylvie Fiat > Ingénieur d'étude > Unité 227 "Biocomplexité des écosystèmes coralliens de l'Indo-Pacifique" > Institut de Recherche pour le Développement > B.P. A5 > 98848, Nouméa Cedex > Nouvelle-Calédonie > Tél. : (687) 26 07 95 > > > -- Sylvie Fiat Ingénieur d'étude Unité 227 "Biocomplexité des écosystèmes coralliens de l'Indo-Pacifique" Institut de Recherche pour le Développement B.P. A5 98848, Nouméa Cedex Nouvelle-Calédonie Tél. : (687) 26 07 95 |