[GeoNetwork-devel] stumped by MEF import error "Root element not set"

I am stumped by a "Root element not set" error when importing my MEF files through the metadata insert form, the batch metadata upload form, and when submitting the MEF file to /srv/en/xml.metadata.insert (GeoNetwork 2.4.1). The metadat.xml is ISO 19139 schema valid and I can't see anything wrong with my info.xml.

What am I missing?

Following is the error for my multipart/form-data POST to /srv/en/xml.metadata.insert. I ahve attached an example MEF

2009-11-04 14:46:09,648 INFO [jeeves.request] - ==========================================================

2009-11-04 14:46:09,648 INFO [jeeves.request] - HTML Request (from 127.0.0.1) : /geonetwork/srv/en/xml.user.login

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Method : POST

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Content type : application/x-www-form-urlencoded

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Accept : text/plain

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Session id is F08E0763DA2E8A0391219CCB56642CA0

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Session created for client : 127.0.0.1

2009-11-04 14:46:09,648 INFO [jeeves.service] - Dispatching : xml.user.login

2009-11-04 14:46:09,648 DEBUG [jeeves.service] - -> parameters are :

<request>

  <password>admin</password>

  <username>admin</username>

</request>

2009-11-04 14:46:09,648 INFO [jeeves.webapp.xml.user.login] - User 'admin' logged in as 'Administrator'

2009-11-04 14:46:09,648 INFO [jeeves.service] - -> dispatching to output for : xml.user.login

2009-11-04 14:46:09,648 INFO [jeeves.service] - -> writing xml for : xml.user.login

2009-11-04 14:46:09,648 DEBUG [jeeves.service] - Service xml is :

<ok />

2009-11-04 14:46:09,648 INFO [jeeves.service] - -> output ended for : xml.user.login

2009-11-04 14:46:09,648 INFO [jeeves.service] - -> dispatch ended for : xml.user.login

2009-11-04 14:46:09,648 INFO [jeeves.request] - ==========================================================

2009-11-04 14:46:09,648 INFO [jeeves.request] - HTML Request (from 127.0.0.1) : /geonetwork/srv/en/mef.import

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Method : POST

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Content type : multipart/form-data; boundary=192.168.56.1.1.412.1257371169.648.1

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Accept : null

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Session id is F08E0763DA2E8A0391219CCB56642CA0

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Uploading file C:\azgs_borehole_mef\082FFAC8-AFA7-44A5-8870-86AEA5C12DC1.mef type: application/octet-stream size: 13877

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - File is called 082FFAC8-AFA7-44A5-8870-86AEA5C12DC1.mef after simplification

2009-11-04 14:46:09,664 DEBUG [jeeves.request] - Adding to parameters: <mefFile type="file" size="13877" content-type="application/octet-stream">082FFAC8-AFA7-44A5-8870-86AEA5C12DC1.mef</mefFile>

2009-11-04 14:46:09,664 INFO [jeeves.service] - Dispatching : mef.import

2009-11-04 14:46:09,664 DEBUG [jeeves.service] - -> parameters are :

<params>

  <mefFile type="file" size="13877" content-type="application/octet-stream">082FFAC8-AFA7-44A5-8870-86AEA5C12DC1.mef</mefFile>

</params>

2009-11-04 14:46:09,710 DEBUG [jeeves.webapp.mef.import] - Adding metadata with uuid=082FFAC8-AFA7-44A5-8870-86AEA5C12DC1

2009-11-04 14:46:09,710 ERROR [jeeves.service] - Exception when executing service

2009-11-04 14:46:09,710 ERROR [jeeves.service] - (C) Exc : java.lang.IllegalStateException: Root element not set

2009-11-04 14:46:09,710 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="2036" method="updateFixedInfo" />

    <at class="org.fao.geonet.kernel.DataManager" file="DataManager.java" line="1998" method="updateFixedInfoExisting" />

    <at class="org.fao.geonet.kernel.DataManager" file="DataManager.java" line="920" method="insertMetadataExt" />

    <at class="org.fao.geonet.kernel.mef.Importer$1" file="Importer.java" line="200" method="handleInfo" />

    <at class="org.fao.geonet.kernel.mef.MEFFileVisitor" file="MEFFileVisitor.java" line="93" method="handleXml" />

    <at class="org.fao.geonet.kernel.mef.MEFFileVisitor" file="MEFFileVisitor.java" line="50" 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" />

  </stack>

  <request>

    <language>en</language>

    <service>mef.import</service>

  </request>

</error>

2009-11-04 14:46:09,710 INFO [jeeves.service] - -> dispatching to error for : mef.import

2009-11-04 14:46:09,726 INFO [jeeves.service] - -> transforming with stylesheet : C:\Tomcat5527\webapps\geonetwork\/xsl/error.xsl

2009-11-04 14:46:09,742 INFO [jeeves.service] - -> end error transformation for : mef.import

2009-11-04 14:46:09,742 INFO [jeeves.service] - -> error ended for : mef.import

2009-11-04 14:46:09,742 INFO [jeeves.request] - ==========================================================

2009-11-04 14:46:09,742 INFO [jeeves.request] - HTML Request (from 127.0.0.1) : /geonetwork/srv/en/xml.user.logout

2009-11-04 14:46:09,742 DEBUG [jeeves.request] - Method : GET

2009-11-04 14:46:09,742 DEBUG [jeeves.request] - Content type : null

2009-11-04 14:46:09,742 DEBUG [jeeves.request] - Accept : null

2009-11-04 14:46:09,742 DEBUG [jeeves.request] - Session id is F08E0763DA2E8A0391219CCB56642CA0

2009-11-04 14:46:09,742 INFO [jeeves.service] - Dispatching : xml.user.logout

2009-11-04 14:46:09,742 DEBUG [jeeves.service] - -> no input parameters

2009-11-04 14:46:09,742 INFO [jeeves.service] - -> dispatching to output for : xml.user.logout

2009-11-04 14:46:09,742 INFO [jeeves.service] - -> writing xml for : xml.user.logout

2009-11-04 14:46:09,742 DEBUG [jeeves.service] - Service xml is :

<ok />

2009-11-04 14:46:09,742 INFO [jeeves.service] - -> output ended for : xml.user.logout

2009-11-04 14:46:09,742 INFO [jeeves.service] - -> dispatch ended for : xml.user.logout

--
_______________________________
Wolfgang Grunberg
Arizona Geological Survey
wgrunberg@anonymised.com
520-770-3500

(attachments)

1AD897A5-369E-4EFF-9328-9FAAD11C992D.mef (13.2 KB)

My bad. I referenced a CSW name space that is not part of ISO 19115 (leftover from my CSW insert transaction xsd).
WG
Wolfgang Grunberg wrote:

···
_______________________________
Wolfgang Grunberg
Arizona Geological Survey
[wgrunberg@anonymised.com](mailto:wgrunberg@anonymised.com)
520-770-3500

I am stumped by a “Root element not set” error when importing my MEF files through the metadata insert form, the batch metadata upload form, and when submitting the MEF file to /srv/en/xml.metadata.insert (GeoNetwork 2.4.1). The metadat.xml is ISO 19139 schema valid and I can’t see anything wrong with my info.xml.

What am I missing?

Following is the error for my multipart/form-data POST to /srv/en/xml.metadata.insert. I ahve attached an example MEF

2009-11-04 14:46:09,648 INFO [jeeves.request] - ==========================================================

2009-11-04 14:46:09,648 INFO [jeeves.request] - HTML Request (from 127.0.0.1) : /geonetwork/srv/en/xml.user.login

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Method : POST

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Content type : application/x-www-form-urlencoded

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Accept : text/plain

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Session id is F08E0763DA2E8A0391219CCB56642CA0

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Session created for client : 127.0.0.1

2009-11-04 14:46:09,648 INFO [jeeves.service] - Dispatching : xml.user.login

2009-11-04 14:46:09,648 DEBUG [jeeves.service] - → parameters are :

admin

admin

2009-11-04 14:46:09,648 INFO [jeeves.webapp.xml.user.login] - User ‘admin’ logged in as ‘Administrator’

2009-11-04 14:46:09,648 INFO [jeeves.service] - → dispatching to output for : xml.user.login

2009-11-04 14:46:09,648 INFO [jeeves.service] - → writing xml for : xml.user.login

2009-11-04 14:46:09,648 DEBUG [jeeves.service] - Service xml is :

2009-11-04 14:46:09,648 INFO [jeeves.service] - → output ended for : xml.user.login

2009-11-04 14:46:09,648 INFO [jeeves.service] - → dispatch ended for : xml.user.login

2009-11-04 14:46:09,648 INFO [jeeves.request] - ==========================================================

2009-11-04 14:46:09,648 INFO [jeeves.request] - HTML Request (from 127.0.0.1) : /geonetwork/srv/en/mef.import

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Method : POST

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Content type : multipart/form-data; boundary=192.168.56.1.1.412.1257371169.648.1

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Accept : null

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Session id is F08E0763DA2E8A0391219CCB56642CA0

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Uploading file C:\azgs_borehole_mef\082FFAC8-AFA7-44A5-8870-86AEA5C12DC1.mef type: application/octet-stream size: 13877

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - File is called 082FFAC8-AFA7-44A5-8870-86AEA5C12DC1.mef after simplification

2009-11-04 14:46:09,664 DEBUG [jeeves.request] - Adding to parameters: 082FFAC8-AFA7-44A5-8870-86AEA5C12DC1.mef

2009-11-04 14:46:09,664 INFO [jeeves.service] - Dispatching : mef.import

2009-11-04 14:46:09,664 DEBUG [jeeves.service] - → parameters are :

082FFAC8-AFA7-44A5-8870-86AEA5C12DC1.mef

2009-11-04 14:46:09,710 DEBUG [jeeves.webapp.mef.import] - Adding metadata with uuid=082FFAC8-AFA7-44A5-8870-86AEA5C12DC1

2009-11-04 14:46:09,710 ERROR [jeeves.service] - Exception when executing service

2009-11-04 14:46:09,710 ERROR [jeeves.service] - (C) Exc : java.lang.IllegalStateException: Root element not set

2009-11-04 14:46:09,710 DEBUG [jeeves.service] - Raised exception while executing service

Root element not set

IllegalStateException

en

mef.import

2009-11-04 14:46:09,710 INFO [jeeves.service] - → dispatching to error for : mef.import

2009-11-04 14:46:09,726 INFO [jeeves.service] - → transforming with stylesheet : C:\Tomcat5527\webapps\geonetwork/xsl/error.xsl

2009-11-04 14:46:09,742 INFO [jeeves.service] - → end error transformation for : mef.import

2009-11-04 14:46:09,742 INFO [jeeves.service] - → error ended for : mef.import

2009-11-04 14:46:09,742 INFO [jeeves.request] - ==========================================================

2009-11-04 14:46:09,742 INFO [jeeves.request] - HTML Request (from 127.0.0.1) : /geonetwork/srv/en/xml.user.logout

2009-11-04 14:46:09,742 DEBUG [jeeves.request] - Method : GET

2009-11-04 14:46:09,742 DEBUG [jeeves.request] - Content type : null

2009-11-04 14:46:09,742 DEBUG [jeeves.request] - Accept : null

2009-11-04 14:46:09,742 DEBUG [jeeves.request] - Session id is F08E0763DA2E8A0391219CCB56642CA0

2009-11-04 14:46:09,742 INFO [jeeves.service] - Dispatching : xml.user.logout

2009-11-04 14:46:09,742 DEBUG [jeeves.service] - → no input parameters

2009-11-04 14:46:09,742 INFO [jeeves.service] - → dispatching to output for : xml.user.logout

2009-11-04 14:46:09,742 INFO [jeeves.service] - → writing xml for : xml.user.logout

2009-11-04 14:46:09,742 DEBUG [jeeves.service] - Service xml is :

2009-11-04 14:46:09,742 INFO [jeeves.service] - → output ended for : xml.user.logout

2009-11-04 14:46:09,742 INFO [jeeves.service] - → dispatch ended for : xml.user.logout


---

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  [http://p.sf.net/sfu/bobj-july](http://p.sf.net/sfu/bobj-july)

---

_______________________________________________
GeoNetwork-devel mailing list
[GeoNetwork-devel@lists.sourceforge.net](mailto:GeoNetwork-devel@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geonetwork-devel](https://lists.sourceforge.net/lists/listinfo/geonetwork-devel)
GeoNetwork OpenSource is maintained at [http://sourceforge.net/projects/geonetwork](http://sourceforge.net/projects/geonetwork)

hey, you get the error if you select the wrong schema type. Make sure you
select the correct one before you upload. Hope that helps.

wgrunberg wrote:

I am stumped by a "Root element not set" error when importing my MEF
files through the metadata insert form, the batch metadata upload form,
and when submitting the MEF file to /srv/en/xml.metadata.insert
(GeoNetwork 2.4.1). The metadat.xml is ISO 19139 schema valid and I
can't see anything wrong with my info.xml.

What am I missing?

Following is the error for my multipart/form-data POST to
/srv/en/xml.metadata.insert. I ahve attached an example MEF

2009-11-04 14:46:09,648 INFO [jeeves.request] -

2009-11-04 14:46:09,648 INFO [jeeves.request] - HTML Request (from
127.0.0.1) : /geonetwork/srv/en/xml.user.login

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Method : POST

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Content type :
application/x-www-form-urlencoded

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Accept : text/plain

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Session id is
F08E0763DA2E8A0391219CCB56642CA0

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Session created for
client : 127.0.0.1

2009-11-04 14:46:09,648 INFO [jeeves.service] - Dispatching :
xml.user.login

2009-11-04 14:46:09,648 DEBUG [jeeves.service] - -> parameters are :

<request>

  <password>admin</password>

  <username>admin</username>

</request>

2009-11-04 14:46:09,648 INFO [jeeves.webapp.xml.user.login] - User
'admin' logged in as 'Administrator'

2009-11-04 14:46:09,648 INFO [jeeves.service] - -> dispatching to
output for : xml.user.login

2009-11-04 14:46:09,648 INFO [jeeves.service] - -> writing xml for :
xml.user.login

2009-11-04 14:46:09,648 DEBUG [jeeves.service] - Service xml is :

<ok />

2009-11-04 14:46:09,648 INFO [jeeves.service] - -> output ended for :
xml.user.login

2009-11-04 14:46:09,648 INFO [jeeves.service] - -> dispatch ended for :
xml.user.login

2009-11-04 14:46:09,648 INFO [jeeves.request] -

2009-11-04 14:46:09,648 INFO [jeeves.request] - HTML Request (from
127.0.0.1) : /geonetwork/srv/en/mef.import

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Method : POST

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Content type :
multipart/form-data; boundary=192.168.56.1.1.412.1257371169.648.1

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Accept : null

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Session id is
F08E0763DA2E8A0391219CCB56642CA0

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - Uploading file
C:\azgs_borehole_mef\082FFAC8-AFA7-44A5-8870-86AEA5C12DC1.mef type:
application/octet-stream size: 13877

2009-11-04 14:46:09,648 DEBUG [jeeves.request] - File is called
082FFAC8-AFA7-44A5-8870-86AEA5C12DC1.mef after simplification

2009-11-04 14:46:09,664 DEBUG [jeeves.request] - Adding to parameters:
<mefFile type="file" size="13877"
content-type="application/octet-stream">082FFAC8-AFA7-44A5-8870-86AEA5C12DC1.mef</mefFile>

2009-11-04 14:46:09,664 INFO [jeeves.service] - Dispatching : mef.import

2009-11-04 14:46:09,664 DEBUG [jeeves.service] - -> parameters are :

<params>

  <mefFile type="file" size="13877"
content-type="application/octet-stream">082FFAC8-AFA7-44A5-8870-86AEA5C12DC1.mef</mefFile>

</params>

2009-11-04 14:46:09,710 DEBUG [jeeves.webapp.mef.import] - Adding metadata
with uuid=082FFAC8-AFA7-44A5-8870-86AEA5C12DC1

2009-11-04 14:46:09,710 ERROR [jeeves.service] - Exception when executing
service

2009-11-04 14:46:09,710 ERROR [jeeves.service] - (C) Exc :
java.lang.IllegalStateException: Root element not set

2009-11-04 14:46:09,710 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="2036" method="updateFixedInfo" />

    <at class="org.fao.geonet.kernel.DataManager" file="DataManager.java"
line="1998" method="updateFixedInfoExisting" />

    <at class="org.fao.geonet.kernel.DataManager" file="DataManager.java"
line="920" method="insertMetadataExt" />

    <at class="org.fao.geonet.kernel.mef.Importer$1" file="Importer.java"
line="200" method="handleInfo" />

    <at class="org.fao.geonet.kernel.mef.MEFFileVisitor"
file="MEFFileVisitor.java" line="93" method="handleXml" />

    <at class="org.fao.geonet.kernel.mef.MEFFileVisitor"
file="MEFFileVisitor.java" line="50" 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" />

  </stack>

  <request>

    <language>en</language>

    <service>mef.import</service>

  </request>

</error>

2009-11-04 14:46:09,710 INFO [jeeves.service] - -> dispatching to
error for : mef.import

2009-11-04 14:46:09,726 INFO [jeeves.service] - -> transforming with
stylesheet : C:\Tomcat5527\webapps\geonetwork\/xsl/error.xsl

2009-11-04 14:46:09,742 INFO [jeeves.service] - -> end error
transformation for : mef.import

2009-11-04 14:46:09,742 INFO [jeeves.service] - -> error ended for :
mef.import

2009-11-04 14:46:09,742 INFO [jeeves.request] -

2009-11-04 14:46:09,742 INFO [jeeves.request] - HTML Request (from
127.0.0.1) : /geonetwork/srv/en/xml.user.logout

2009-11-04 14:46:09,742 DEBUG [jeeves.request] - Method : GET

2009-11-04 14:46:09,742 DEBUG [jeeves.request] - Content type : null

2009-11-04 14:46:09,742 DEBUG [jeeves.request] - Accept : null

2009-11-04 14:46:09,742 DEBUG [jeeves.request] - Session id is
F08E0763DA2E8A0391219CCB56642CA0

2009-11-04 14:46:09,742 INFO [jeeves.service] - Dispatching :
xml.user.logout

2009-11-04 14:46:09,742 DEBUG [jeeves.service] - -> no input parameters

2009-11-04 14:46:09,742 INFO [jeeves.service] - -> dispatching to
output for : xml.user.logout

2009-11-04 14:46:09,742 INFO [jeeves.service] - -> writing xml for :
xml.user.logout

2009-11-04 14:46:09,742 DEBUG [jeeves.service] - Service xml is :

<ok />

2009-11-04 14:46:09,742 INFO [jeeves.service] - -> output ended for :
xml.user.logout

2009-11-04 14:46:09,742 INFO [jeeves.service] - -> dispatch ended for :
xml.user.logout

--
_______________________________
Wolfgang Grunberg
Arizona Geological Survey
wgrunberg@anonymised.com
520-770-3500

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008
30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--
View this message in context: http://n2.nabble.com/stumped-by-MEF-import-error-Root-element-not-set-tp3948750p4415367.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.