Opened 15 years ago

Closed 15 years ago

#150 closed defect (fixed)

XML metadata insert from single file, java error - 'Root element not set'

Reported by: awalsh Owned by: simonp
Priority: minor Milestone: v2.5.0
Component: User interface (web) Version: v2.4.1
Keywords: Metadata insert Cc:

Description

Using GN2.4.1 from windows installer on WinXPSP3 with Jetty get Java exception when importing a single XML file from Admin->Metadata Insert. Did import with validate option set and no stylesheet transform.

Was importing XML file I saved from the sample record titled "Physiographic Map of North and Central Eurasia (Sample record, please remove!)" provided with the GN install.

Geonetwork.log said:

2009-09-07 10:27:38,234 INFO [jeeves.request] - HTML Request (from 127.0.0.1) : /geonetwork/srv/en/mef.import 2009-09-07 10:27:38,234 DEBUG [jeeves.request] - Method : POST 2009-09-07 10:27:38,234 DEBUG [jeeves.request] - Content type : multipart/form-data; boundary=---------------------------7d9da26803ca 2009-09-07 10:27:38,234 DEBUG [jeeves.request] - Accept : image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */* 2009-09-07 10:27:38,234 DEBUG [jeeves.request] - Session id is ck6exjb2h3y5 2009-09-07 10:27:38,250 DEBUG [jeeves.request] - Uploading file iso19139_fm2.4.1.xml type: text/xml size: 19073 2009-09-07 10:27:38,250 DEBUG [jeeves.request] - File is called iso19139_fm2.4.1.xml after simplification 2009-09-07 10:27:38,281 DEBUG [jeeves.request] - Adding to parameters: <mefFile type="file" size="19073" content-type="text/xml">iso19139_fm2.4.1.xml</mefFile> 2009-09-07 10:27:38,281 INFO [jeeves.service] - Dispatching : mef.import 2009-09-07 10:27:38,281 DEBUG [jeeves.service] - -> parameters are : <params>

<insert_mode>1</insert_mode> <file_type>single</file_type> <data /> <mefFile type="file" size="19073" content-type="text/xml">iso19139_fm2.4.1.xml</mefFile> <template>n</template> <title /> <uuidAction>nothing</uuidAction> <styleSheet>_none_</styleSheet> <validate>on</validate> <group>2</group> <category>_none_</category>

</params> 2009-09-07 10:27:38,343 ERROR [jeeves.service] - Exception when executing service 2009-09-07 10:27:38,343 ERROR [jeeves.service] - (C) Exc : java.lang.IllegalStateException: Root element not set 2009-09-07 10:27:38,343 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.DataManager" file="DataManager.java" line="504" method="extractUUID" /> <at class="org.fao.geonet.kernel.mef.Importer$1" file="Importer.java" line="142" 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" />

</stack> <request>

<language>en</language> <service>mef.import</service>

</request>

</error>

Change History (3)

comment:1 by simonp, 15 years ago

Milestone: v2.4.2v2.5.0
Owner: changed from somebody to simonp

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

in the root element means that the record is being misidentified as a csw Record instead of iso19139

comment:2 by simonp, 15 years ago

In fact any record produced by metadata.show has the csw namespace (xmlns:csw="http://www.opengis.net/cat/csw/2.0.2") added to it - this will cause this problem if the record is reinserted/reimported.

comment:3 by simonp, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in svn commit #5444

Note: See TracTickets for help on using tickets.