Error while trying to read an OpenMS mzML file using "XML Reader" node

Dear list,

This is the configuration of the node:

But I get this error:

Execute failed: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.

Does anyone know what it means?

Thank you!

Roger

Hi Roger,

unfortunately I couldn’t figure out this problem either. Was struggling with it many times.
Now I just read everything in the XMLReader (deactivate XPath) and filter with the XPath node afterwards. Inefficient but works.
XMLReader works if you remove the attributes from the namespace in your XML file (e.g. just write <mzML>…</mzML> and remove the addRootNamespace option but this is hard to automate.
We will fix the FileToTable node for mzMLs hopefully soon.

Cheers
Julianus

Hi Julianus,

Thank you for your reply. I observed that it works by only removing the xmlns=“http://psi.hupo.org/ms/mzml” in the indexedmzML tag. In fact this URL http://psi.hupo.org/ms/mzml is not working. So, could it be that if this URL worked the node would also work?

Cheers

Roger

The URL in the namespace is only an identifier and is not used to retrieve any information. Can you provide a small example file?

Yes, Find attached a simplified version of the mzML file.

180308_Q_QC1X_01_01_short_OK.xml (43.8 KB)

I changed the extension to XML to be able to upload it.

I’ve also removed the xmlns=“http://psi.hupo.org/ms/mzml” at the and tags. In this way it works.

Thanks,

Roger

Actually, I wanted to have an original file so that I can check why the XPath filter is not working in the XML Reader.

Here you can find the complete file:

I just tried your file with the XPath expression that you posted originally and it works without any problems for me, see this workflow.

Interesting, I still can’t. Using your workflow and Roger’s file I get
‘Execute failed: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.’
again.
MacOS Sierra, KNIME 3.5.1 (I had to ignore the warning about your 3.6 nightly workflow)

@thor for KNIME 3.5.2 is not working but for KNIME 3.6.0 works, so obiously the issue has been fixed in the new version, right?

For me it also works in 3.5.3 (and I don’t think we have changed anything in that direction since 3.5.2). Can you two post the corresponding stacktraces from the log file?

Yes, see below:

org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
	at org.apache.xerces.dom.CoreDocumentImpl.checkNamespaceWF(Unknown Source)
	at org.apache.xerces.dom.AttrNSImpl.setName(Unknown Source)
	at org.apache.xerces.dom.AttrNSImpl.<init>(Unknown Source)
	at org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS(Unknown Source)
	at org.apache.xerces.dom.ElementImpl.setAttributeNS(Unknown Source)
	at org.knime.core.data.xml.io.XMLXpathCellReader.lambda$1(XMLXpathCellReader.java:194)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270)
	at java.util.ArrayDeque$DeqSpliterator.forEachRemaining(ArrayDeque.java:958)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at org.knime.core.data.xml.io.XMLXpathCellReader.readXML(XMLXpathCellReader.java:193)
	at org.knime.xml.node.reader.XMLReaderNodeModel.execute(XMLReaderNodeModel.java:292)
	at org.knime.core.node.NodeModel.execute(NodeModel.java:733)
	at org.knime.core.node.NodeModel.executeModel(NodeModel.java:567)
	at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1172)
	at org.knime.core.node.Node.execute(Node.java:959)
	at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:561)
	at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
	at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:179)
	at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:110)
	at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:328)
	at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:204)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
	at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)

Error for KNIME 3.5.2 version:

2018-04-09 17:55:25,899 : DEBUG : KNIME-Worker-2 : Node : XML Reader : 0:1 : Execute failed: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
at org.apache.xerces.dom.CoreDocumentImpl.checkNamespaceWF(Unknown Source)
at org.apache.xerces.dom.AttrNSImpl.setName(Unknown Source)
at org.apache.xerces.dom.AttrNSImpl.(Unknown Source)
at org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS(Unknown Source)
at org.apache.xerces.dom.ElementImpl.setAttributeNS(Unknown Source)
at org.knime.core.data.xml.io.XMLXpathCellReader.lambda$1(XMLXpathCellReader.java:194)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270)
at java.util.ArrayDeque$DeqSpliterator.forEachRemaining(ArrayDeque.java:958)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.knime.core.data.xml.io.XMLXpathCellReader.readXML(XMLXpathCellReader.java:193)
at org.knime.xml.node.reader.XMLReaderNodeModel.execute(XMLReaderNodeModel.java:292)
at org.knime.core.node.NodeModel.execute(NodeModel.java:733)
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:567)
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1172)
at org.knime.core.node.Node.execute(Node.java:959)
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:561)
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:179)
at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:110)
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:328)
at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:204)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)

Can you upload the data file again? Then I can ask some of my colleagues to reproduce the problem. It just works for me.

Sure:

Thanks

Are you two using Windows? It seems that this is problem only affecting Windows (at least we have to internal Windows users that also get the error) which would explain why I cannot reproduce it.

To complicate the situation, I am on macOS Sierra :wink:

Yes, I’m using Windows 10 64 bit

Any new from your side @thor? Thanks!

None of our developers could reproduce the problem with 3.5 but some other Windows users could. For all of them the problem did not occur in the 3.6 nightly builds any more so some changes we did there also fixed this issue.