[GeoNetwork-users] Importing XML

Hello. I have inserted some metadata in a local GeoNetwork according to the
ISO 19115 and 19139. By the way is the new raster standard included yet in
GeoNetwork? Checked (why is it not called Validate?), without error
messages. Exported as XML. Edited only the title in a text editor in order
to test. Now testing to import them on another PC (possibly using a server
computer setup) into GeoNetwork there. Using various options, stylesheets or
not, validate or not, etc. None is successful. The whole idea of
transferring some metadata is not working unless this will work...

I have had cases that
- Nothing seems to happen
- Error that "Root element not set"
- This one may be due to that a thumbnail image cannot be re-used?:
2010-03-30 13:09:15,468 INFO [jeeves.webapp.resources.get] - File is :
C:\SMOLE_soft\geonetwork\web\geonetwork\..\..\data\00000-00099\21\public\orthophoto_sat_s.png
2010-03-30 13:09:15,468 ERROR [jeeves.service] - Exception when executing
service
2010-03-30 13:09:15,468 INFO [jeeves.service] - -> transforming with
stylesheet : C:\SMOLE_soft\geonetwork\web\geonetwork/xsl/error.xsl
2010-03-30 13:09:15,468 ERROR [jeeves.service] - (C) Exc :
ResourceNotFoundEx : Resource not found
2010-03-30 13:09:15,468 DEBUG [jeeves.service] - Raised exception while
executing service

- Some latest messages:
2010-03-30 13:09:15,468 INFO [jeeves.service] - -> dispatching to error
for : resources.get
2010-03-30 13:09:15,468 INFO [jeeves.service] - -> transforming with
stylesheet : C:\SMOLE_soft\geonetwork\web\geonetwork/xsl/error.xsl
2010-03-30 13:09:16,093 INFO [jeeves.service] - -> end error
transformation for : resources.get
2010-03-30 13:09:16,093 INFO [jeeves.service] - -> error ended for :
resources.get
2010-03-30 13:09:16,093 INFO [jeeves.service] - -> end error
transformation for : resources.get
2010-03-30 13:09:16,093 INFO [jeeves.service] - -> error ended for :
resources.get

Arto

Arto,

I could be because when you export the record its putting a csw
namespace attribute into the first line and GN will complain
if you try to re-import that record. Try removing this:

xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"

and then re-import.

HTH

Andrew
----- Original Message ----- From: "Arto Vuorela" <arto.k.vuorela@anonymised.com>
To: <geonetwork-users@lists.sourceforge.net>
Sent: Tuesday, March 30, 2010 9:19 PM
Subject: [GeoNetwork-users] Importing XML

Hello. I have inserted some metadata in a local GeoNetwork according to the
ISO 19115 and 19139. By the way is the new raster standard included yet in
GeoNetwork? Checked (why is it not called Validate?), without error
messages. Exported as XML. Edited only the title in a text editor in order
to test. Now testing to import them on another PC (possibly using a server
computer setup) into GeoNetwork there. Using various options, stylesheets or
not, validate or not, etc. None is successful. The whole idea of
transferring some metadata is not working unless this will work...

I have had cases that
- Nothing seems to happen
- Error that "Root element not set"
- This one may be due to that a thumbnail image cannot be re-used?:
2010-03-30 13:09:15,468 INFO [jeeves.webapp.resources.get] - File is :
C:\SMOLE_soft\geonetwork\web\geonetwork\..\..\data\00000-00099\21\public\orthophoto_sat_s.png
2010-03-30 13:09:15,468 ERROR [jeeves.service] - Exception when executing
service
2010-03-30 13:09:15,468 INFO [jeeves.service] - -> transforming with
stylesheet : C:\SMOLE_soft\geonetwork\web\geonetwork/xsl/error.xsl
2010-03-30 13:09:15,468 ERROR [jeeves.service] - (C) Exc :
ResourceNotFoundEx : Resource not found
2010-03-30 13:09:15,468 DEBUG [jeeves.service] - Raised exception while
executing service

- Some latest messages:
2010-03-30 13:09:15,468 INFO [jeeves.service] - -> dispatching to error
for : resources.get
2010-03-30 13:09:15,468 INFO [jeeves.service] - -> transforming with
stylesheet : C:\SMOLE_soft\geonetwork\web\geonetwork/xsl/error.xsl
2010-03-30 13:09:16,093 INFO [jeeves.service] - -> end error
transformation for : resources.get
2010-03-30 13:09:16,093 INFO [jeeves.service] - -> error ended for :
resources.get
2010-03-30 13:09:16,093 INFO [jeeves.service] - -> end error
transformation for : resources.get
2010-03-30 13:09:16,093 INFO [jeeves.service] - -> error ended for :
resources.get

Arto
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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

Thanks for the suggestion, but leaving out that csw line did not help.
Attached is the original XML. The log said:

==========================================================
2010-04-03 16:55:48,187 INFO [jeeves.request] - HTML Request (from
127.0.0.1) : /geonetwork/srv/en/mef.import
2010-04-03 16:55:48,187 DEBUG [jeeves.request] - Method : POST
2010-04-03 16:55:48,187 DEBUG [jeeves.request] - Content type :
multipart/form-data; boundary=---------------------------7da8c3020410
2010-04-03 16:55:48,187 DEBUG [jeeves.request] - Accept : image/gif,
image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash,
application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap,
application/x-ms-application, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, */*
2010-04-03 16:55:48,187 DEBUG [jeeves.request] - Session id is 2igr9npfyfxo
2010-04-03 16:55:48,250 DEBUG [jeeves.request] - Uploading file C:\Documents
and Settings\avu67\My
Documents\projektit\SMOLE-II\Metadata\copies\iso19139_Ortho8000_noCSW.xml
type: text/xml size: 18369
2010-04-03 16:55:48,265 DEBUG [jeeves.request] - File is called
iso19139_Ortho8000_noCSW.xml after simplification
2010-04-03 16:55:48,296 DEBUG [jeeves.request] - Adding to parameters:
<mefFile type="file" size="18369"
content-type="text/xml">iso19139_Ortho8000_noCSW.xml</mefFile>
2010-04-03 16:55:48,296 INFO [jeeves.service] - Dispatching : mef.import
2010-04-03 16:55:48,296 DEBUG [jeeves.service] - -> parameters are :
<params>
  <insert_mode>1</insert_mode>
  <file_type>single</file_type>
  <data />
  <mefFile type="file" size="18369"
content-type="text/xml">iso19139_Ortho8000_noCSW.xml</mefFile>
  <template>n</template>
  <title />
  <uuidAction>generateUUID</uuidAction>
  <styleSheet>ISO19115-to-ISO19139.xsl</styleSheet>
  <validate>on</validate>
  <group>3</group>
  <category>1</category>
</params>
2010-04-03 16:55:48,703 ERROR [jeeves.service] - Exception when executing
service
2010-04-03 16:55:48,703 ERROR [jeeves.service] - (C) Exc :
java.lang.IllegalStateException: Root element not set
2010-04-03 16:55:48,703 DEBUG [jeeves.service] - Raised exception while
executing service
<error id="error">
  <message>Root element not set</message>
  <class>IllegalStateException</class>
  <stack>
    <at class="org.jdom.Document" file="Document.java" line="218"
method="getRootElement" />
    <at class="jeeves.utils.Xml" file="Xml.java" line="185"
method="transform" />
    <at class="org.fao.geonet.kernel.mef.Importer$1" file="Importer.java"
line="136" method="handleInfo" />
    <at class="org.fao.geonet.kernel.mef.XMLFileVisitor"
file="XMLFileVisitor.java" line="59" method="handleXml" />
    <at class="org.fao.geonet.kernel.mef.XMLFileVisitor"
file="XMLFileVisitor.java" line="41" method="visit" />
    <at class="org.fao.geonet.kernel.mef.MEFLib" file="MEFLib.java"
line="62" method="visit" />
    <at class="org.fao.geonet.kernel.mef.Importer" file="Importer.java"
line="86" method="doImport" />
    <at class="org.fao.geonet.kernel.mef.MEFLib" file="MEFLib.java"
line="47" method="doImport" />
    <at class="org.fao.geonet.services.mef.Import" file="Import.java"
line="58" method="exec" />
    <at class="jeeves.server.dispatchers.ServiceInfo"
file="ServiceInfo.java" line="238" method="execService" />
  </stack>
  <request>
    <language>en</language>
    <service>mef.import</service>
  </request>
</error>
2010-04-03 16:55:48,703 INFO [jeeves.service] - -> dispatching to error
for : mef.import
2010-04-03 16:55:48,734 INFO [jeeves.service] - -> transforming with
stylesheet : C:\SMOLE_soft\geonetwork\web\geonetwork/xsl/error.xsl
2010-04-03 16:55:48,968 INFO [jeeves.service] - -> end error
transformation for : mef.import
2010-04-03 16:55:48,968 INFO [jeeves.service] - -> error ended for :
mef.import

Don't know yet how to debug these... I am not sure if e.g. the RS_Identifier
is correct. Is the EPSG:21037 wrongly set?

Arto

(attachments)

iso19139_Ortho8000.xml (18 KB)

According to the previous discussion
http://n2.nabble.com/XML-Metadata-Insert-gives-Root-element-not-set-td2013361.html,
a
wrong schema might indeed be the reason for "Root element not set" error. As
http://www.opengis.net/cat/csw/2.0.2 seems to be available no more, perhaps
it should be xmlns:csw=http://schemas.opengis.net/gml/3.1.1/base? Or is it
a too new version for the exported XML files? How about all other web
addresses generated by GN into the XML, should I check them all, or only the
csw refers to schema? And the <DS_DataSet> and <has> tags mentioned in the
previous discussion do not exist... Tried to add them too, but no success.

http://trac.osgeo.org/geonetwork/ticket/150 and
http://n2.nabble.com/Defining-a-new-schema-in-2-4-1-is-broken-td3838557.html
include
some discussions about the mentioned error too. Wished to make the import
work!

Arto

http://trac.osgeo.org/geonetwork/ticket/150 tells the CSW issue is solved
and should be fixed in *v2.5.0.*
After all, removing the xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot; the
import worked OK, *if* I did not use a Stylesheet, which may mean a
transformation from one system to another. And my metadata was created using
the ISO template already, therefore no need to transform. Firstly, I think
it should work with the (null) transformation as well.
Secondly, trying to insert (import) many XLS files did not work, I had to do
it one by one.

Arto