Hi Andrew,
I'll have a go - looks like the problem is in the autodetectSchema method in DataManager.java or perhaps further down whatever method is calling autodetectSchema as a result of detecting the wrong schema or not detecting any schema. You could check that your schema is supported by that method. Work is under way to take some of the pain out of this autodetection process and other issues related to schema/profile support (see the proposal pluginprofiles – GeoNetwork opensource Developer website)
Cheers,
Simon
________________________________________
From: Andrew Watkins [a.watkins@anonymised.com]
Sent: Monday, 20 September 2010 8:23 AM
To: geonetwork-devel@lists.sourceforge.net
Subject: [GeoNetwork-devel] need clues in integrating a new profile into CSW
I've added a new local profile to my BlueNetMEST Geonetwork. Prefix is niwa: for testing purposes I have simply cloned all the mcp: profile schemas and stylesheets.
I can create and edit records in GN proper but am getting problems when trying to push records into the system.
for example this test code
<csw:Transaction service="CSW" version="2.0.2" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2">
<csw:Insert>
<niwa:MD_Metadata xmlns="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:niwa="www.niwa.co.nz/schemas/iso19139/niwa<http://www.niwa.co.nz/schemas/iso19139/niwa>" gco:isoType="gmd:MD_Metadata">
<item>Hello NIWA</item>
</niwa:MD_Metadata>
</csw:Insert>
</csw:Transaction>
returns
<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd">
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>Cannot process transaction: null</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>
with little extra help in the logfile
2010-09-20 10:16:34,692 DEBUG [geonetwork.datamanager] - Autodetect schema for: 'niwa:MD_Metadata' with namespace '[Namespace: prefix "niwa" is mapped to URI "www.niwa.co.nz/schemas/iso19139/niwa<http://www.niwa.co.nz/schemas/iso19139/niwa>"\]'
2010-09-20 10:16:34,692 ERROR [geonetwork.csw] - Cannot process transaction
2010-09-20 10:16:34,692 ERROR [geonetwork.csw] - (C) StackTrace
java.lang.NullPointerException
A similar posting without the niwa prefix and namespace works ok.
So I've missed registering or looking up the mapping to the installed profiles somewhere - but all the code I can find looks ok.
Any suggestions on where to look welcome
And any pointers to docs on adding profiles would be gratefully accepted.
Thanks Andrew
NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.