Error: The name "ESD Measurement" is not legal for JDOM/XML elements

Hi everyone,

I am using Sentinel-1 IW SLC image to obtain the C2 polarimetric matrix.
I mainly use “gpt + a xml file” and want to save the output in PolSARpro format.

I was able to obtain the matrix using the following flow for single frame and single subswath.

However, SNAP failed when I tried the following flow for single frame and two subswaths.

I encountered the following error:

INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL 3.0.2 found on system. JNI driver will be used.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 3.0.2 set to be used by SNAP.
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 3.0.2 set to be used by SNAP.
INFO: org.hsqldb.persist.Logger: dataFileCache open start
org.jdom2.IllegalNameException: The name “ESD Measurement” is not legal for JDOM/XML elements: XML name ‘ESD Measurement’ cannot contain the character " ".
at org.jdom2.Element.setName(Element.java:227)
at org.jdom2.Element.(Element.java:161)
at org.jdom2.Element.(Element.java:173)
at org.esa.snap.core.dataop.downloadable.XMLSupport.metadataElementToDOMElement(XMLSupport.java:123)
at org.esa.snap.engine_utilities.datamodel.metadata.AbstractMetadataIO.Save(AbstractMetadataIO.java:84)
at org.esa.snap.engine_utilities.datamodel.metadata.AbstractMetadataIO.saveExternalMetadata(AbstractMetadataIO.java:70)
at org.esa.s1tbx.io.polsarpro.PolsarProProductWriter.writeProductNodesImpl(PolsarProProductWriter.java:67)
at org.esa.snap.core.dataio.AbstractProductWriter.writeProductNodes(AbstractProductWriter.java:111)
at org.esa.snap.core.gpf.common.WriteOp.doExecute(WriteOp.java:315)
at org.esa.snap.core.gpf.internal.OperatorContext.executeOperator(OperatorContext.java:1300)
at org.esa.snap.core.gpf.Operator.execute(Operator.java:153)
at org.esa.snap.core.gpf.graph.GraphProcessor.executeGraph(GraphProcessor.java:189)
at org.esa.snap.core.gpf.graph.GraphProcessor.executeGraph(GraphProcessor.java:119)
at org.esa.snap.core.gpf.main.DefaultCommandLineContext.executeGraph(DefaultCommandLineContext.java:86)
at org.esa.snap.core.gpf.main.CommandLineTool.executeGraph(CommandLineTool.java:547)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:391)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:287)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:188)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:121)
at org.esa.snap.core.gpf.main.GPT.run(GPT.java:60)
at org.esa.snap.core.gpf.main.GPT.main(GPT.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.esa.snap.runtime.Launcher.lambda$run$0(Launcher.java:55)
at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)
at org.esa.snap.runtime.Launcher.run(Launcher.java:51)
at org.esa.snap.runtime.Launcher.main(Launcher.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84)
at com.install4j.runtime.launcher.UnixLauncher.start(UnixLauncher.java:66)
at install4j.org.esa.snap.runtime.Launcher1159904018.main(Unknown Source)
Error: The name “ESD Measurement” is not legal for JDOM/XML elements: XML name ‘ESD Measurement’ cannot contain the character " ".

I did read the following two posts:
https://forum.step.esa.int/t/the-issue-of-exporting-different-formats/34819
https://forum.step.esa.int/t/error-in-subset-operation/32232/3
, but since the .dim file will not be generated in my case, I wonder if anyone know what could be the cause for this error?

Any helps will be appreciated!
Thank you in advance~

I see the dilemma here. Could you please share the xml files?

@YCChen

I got the same error while doing subset after Merge operation

I just opened .dim file of Merge operation in notepad, and removed space in “ESD Measurement” (as suggested in video)
and it worked fine for me.

Thank you

Hello @ABraun,

This is the xml file:
polMatrix_20170105.xml (5.8 KB)
Note that the absolute file path is not specified for the Read and Write operators.

The frame I tested is S1A_IW_SLC__1SDV_20170105T215223_20170105T215259_014702_017EC6_23C2.zip.

Thank you!

Hello @Dev,

The error persists even when the Subset operator is removed from the flow.

As I am not generating the output step by step, no .dim file will be produced. Namely, I expect only an output in PolSARpro format.

Hope this clarify my question :slight_smile:

Strangely, I get a “Input should be a SAR product” error message, but only with the “Subset” operator. When I remove it, the processing competes.

Put the “Subset” operator after “Polarimetric Speckle Filter” and the script runs through - at least on my side.

Hi @ABraun,

I also encountered the “Input should be a SAR product” error message before but forgot the exact steps I applied.

I tried your suggestion (putting the “Subset” operator after “Polarimetric Speckle Filter”) but still got the same “ESD Measurement” error message. Removing the “Subset” operator ended up returning the same error as well.

What could be the reason that I am not able to run on my side? Software version? (I updated all packages to the newest version.)

Forgot to mention, I was able to run the same flow last year around May. So this is really strange.

I also experience this quite unpredictable. Can’t see any sense in it, sorry.
Is it an option to split the graph into two parts or process the subset manually?

HI @ABraun,

I don’t think the problem is related to the Subset operator because I am able to run the flow successfully when the output format is BEAM-DIMAP not PolSARPro.

So I am thinking about saving the result in BEAM-DIMAP format and using gdal_translate to convert the format. I suppose PolSARPro format is actually ENVI format?

Now I see, right…
Would be worth a try to manually translate it.