You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Maria Milosavljevic <mm...@googlemail.com> on 2007/08/29 09:16:34 UTC
NAMESPACE_ERR
Hi.
I have just upgraded to the most recent version of UIMA and I'm not sure if
this is the reason for my problem. I have a very simple JUnit test:
@Test()
public void testSimpleUIMAExample() throws Exception
{
String xmlInputDescriptor =
"W:/Development/Tools/apache-uima/examples/descriptors/tutorial/ex6/UimaMeetingDetectorTAE.xml";
try
{
XMLInputSource in = new XMLInputSource(xmlInputDescriptor);
ResourceSpecifier specifier = UIMAFramework.getXMLParser()
.parseResourceSpecifier(in);
PipelineManager manager = new
PipelineManager(xmlInputDescriptor);
}
catch (Exception e)
{
log.error("Error creating analysis engine: " +
xmlInputDescriptor);
e.printStackTrace();
throw e;
}
}
which used to work but now fails here:
ERROR 05:14:34 PM [main] (PipelineManagerTest.java:31) - Error creating
analysis engine:
W:/Development/Tools/apache-uima/examples/descriptors/tutorial/ex6/UimaMeetingDetectorTAE.xml
org.apache.uima.util.InvalidXMLException: Invalid descriptor at
file:/W:/Development/Tools/apache-uima/examples/descriptors/tutorial/ex6/UimaMeetingDetectorTAE.xml.
at org.apache.uima.util.impl.XMLParser_impl.parse
(XMLParser_impl.java:193)
at org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier
(XMLParser_impl.java:365)
at org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier
(XMLParser_impl.java:346)
at com.relevant.pipeline.PipelineManagerTest.testSimpleUIMAExample(
PipelineManagerTest.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(
JUnit38ClassRunner.java:81)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
RemoteTestRunner.java:196)
Caused by: org.apache.crimson.tree.DomEx: NAMESPACE_ERR: Attempt to create
or change an object in a way which is incorrect with regard to namespaces.
at org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:354)
at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(
TransformerIdentityImpl.java:1031)
at org.apache.uima.util.impl.SaxDeserializer_impl.startElement
(SaxDeserializer_impl.java:201)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1488)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at org.apache.uima.util.impl.XMLParser_impl.parse
(XMLParser_impl.java:176)
... 22 more
and I have no idea why. I have not edited the tutorial descriptor. And I
can't remember if this is the first time I've tested this since upgrading!
Any suggestions?
Thanks,
Maria
Re: NAMESPACE_ERR
Posted by Marshall Schor <ms...@schor.com>.
Hi Maria -
I tried reproducing this but both my attempts in Java 5 and Java 6
worked, using JVMs from Sun and IBM.
I see from the error message below that your Java is using the "Crimson"
XML parser. This page describes various XML parsers;
http://java.sun.com/webservices/jaxp/reference/faqs/index.html
In particular, it says:
As of March 2006, Apache has several Java parsers: Crimson, Xerces 1,
and Xerces 2. The reason is historical -- because Apache accepted two
donations from two different companies. IBM donated XML4J which became
Apache Xerces 1. Sun donated Project X which became Apache Crimson.
Xerces 2 is a new third parser which is a rewrite. It has goals such as
maintainability, modularity, and the implementation of certain features,
which neither of the previous original parsers has achieved. Xerces 2
was designed to fill the long-term needs of Apache projects going
forward. The current version of Xerces is 2.8.
I think that both Sun and IBM are now using Xerces 2 in their current
JVMs. For instance, see
http://java.sun.com/j2se/1.5.0/docs/guide/xml/jaxp/ReleaseNotes_150.html#parsing
for info on Sun's Java 5 version.
What version of Java are you using?
-Marshall
Maria Milosavljevic wrote:
> Hi.
>
> I have just upgraded to the most recent version of UIMA and I'm not sure if
> this is the reason for my problem. I have a very simple JUnit test:
>
> @Test()
> public void testSimpleUIMAExample() throws Exception
> {
> String xmlInputDescriptor =
> "W:/Development/Tools/apache-uima/examples/descriptors/tutorial/ex6/UimaMeetingDetectorTAE.xml";
> try
> {
> XMLInputSource in = new XMLInputSource(xmlInputDescriptor);
> ResourceSpecifier specifier = UIMAFramework.getXMLParser()
> .parseResourceSpecifier(in);
> PipelineManager manager = new
> PipelineManager(xmlInputDescriptor);
> }
> catch (Exception e)
> {
> log.error("Error creating analysis engine: " +
> xmlInputDescriptor);
> e.printStackTrace();
> throw e;
>
> }
> }
>
> which used to work but now fails here:
>
> ERROR 05:14:34 PM [main] (PipelineManagerTest.java:31) - Error creating
> analysis engine:
> W:/Development/Tools/apache-uima/examples/descriptors/tutorial/ex6/UimaMeetingDetectorTAE.xml
> org.apache.uima.util.InvalidXMLException: Invalid descriptor at
> file:/W:/Development/Tools/apache-uima/examples/descriptors/tutorial/ex6/UimaMeetingDetectorTAE.xml.
> at org.apache.uima.util.impl.XMLParser_impl.parse
> (XMLParser_impl.java:193)
> at org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier
> (XMLParser_impl.java:365)
> at org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier
> (XMLParser_impl.java:346)
> at com.relevant.pipeline.PipelineManagerTest.testSimpleUIMAExample(
> PipelineManagerTest.java:24)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> at junit.framework.TestSuite.run(TestSuite.java:227)
> at org.junit.internal.runners.JUnit38ClassRunner.run(
> JUnit38ClassRunner.java:81)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> JUnit4TestReference.java:38)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:460)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:673)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> RemoteTestRunner.java:386)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:196)
> Caused by: org.apache.crimson.tree.DomEx: NAMESPACE_ERR: Attempt to create
> or change an object in a way which is incorrect with regard to namespaces.
> at org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:354)
> at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(
> TransformerIdentityImpl.java:1031)
> at org.apache.uima.util.impl.SaxDeserializer_impl.startElement
> (SaxDeserializer_impl.java:201)
> at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1488)
> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
> at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
> at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
> at org.apache.uima.util.impl.XMLParser_impl.parse
> (XMLParser_impl.java:176)
> ... 22 more
>
> and I have no idea why. I have not edited the tutorial descriptor. And I
> can't remember if this is the first time I've tested this since upgrading!
>
> Any suggestions?
>
> Thanks,
>
> Maria
>
>
Re: NAMESPACE_ERR
Posted by Thilo Goetz <tw...@gmx.de>.
Hi Maria,
which JVM are you using? Could you try a different JVM?
There are various problems with the XML parsers of some
JVMs. If this is a Java 5 version, please try the most
recent Java 6, you may have more luck.
HTH,
Thilo
Maria Milosavljevic wrote:
> Hi.
>
> I have just upgraded to the most recent version of UIMA and I'm not sure if
> this is the reason for my problem. I have a very simple JUnit test:
>
> @Test()
> public void testSimpleUIMAExample() throws Exception
> {
> String xmlInputDescriptor =
> "W:/Development/Tools/apache-uima/examples/descriptors/tutorial/ex6/UimaMeetingDetectorTAE.xml";
> try
> {
> XMLInputSource in = new XMLInputSource(xmlInputDescriptor);
> ResourceSpecifier specifier = UIMAFramework.getXMLParser()
> .parseResourceSpecifier(in);
> PipelineManager manager = new
> PipelineManager(xmlInputDescriptor);
> }
> catch (Exception e)
> {
> log.error("Error creating analysis engine: " +
> xmlInputDescriptor);
> e.printStackTrace();
> throw e;
>
> }
> }
>
> which used to work but now fails here:
>
> ERROR 05:14:34 PM [main] (PipelineManagerTest.java:31) - Error creating
> analysis engine:
> W:/Development/Tools/apache-uima/examples/descriptors/tutorial/ex6/UimaMeetingDetectorTAE.xml
> org.apache.uima.util.InvalidXMLException: Invalid descriptor at
> file:/W:/Development/Tools/apache-uima/examples/descriptors/tutorial/ex6/UimaMeetingDetectorTAE.xml.
> at org.apache.uima.util.impl.XMLParser_impl.parse
> (XMLParser_impl.java:193)
> at org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier
> (XMLParser_impl.java:365)
> at org.apache.uima.util.impl.XMLParser_impl.parseResourceSpecifier
> (XMLParser_impl.java:346)
> at com.relevant.pipeline.PipelineManagerTest.testSimpleUIMAExample(
> PipelineManagerTest.java:24)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:168)
> at junit.framework.TestCase.runBare(TestCase.java:134)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:124)
> at junit.framework.TestSuite.runTest(TestSuite.java:232)
> at junit.framework.TestSuite.run(TestSuite.java:227)
> at org.junit.internal.runners.JUnit38ClassRunner.run(
> JUnit38ClassRunner.java:81)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> JUnit4TestReference.java:38)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:460)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:673)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> RemoteTestRunner.java:386)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:196)
> Caused by: org.apache.crimson.tree.DomEx: NAMESPACE_ERR: Attempt to create
> or change an object in a way which is incorrect with regard to namespaces.
> at org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:354)
> at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(
> TransformerIdentityImpl.java:1031)
> at org.apache.uima.util.impl.SaxDeserializer_impl.startElement
> (SaxDeserializer_impl.java:201)
> at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1488)
> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
> at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
> at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
> at org.apache.uima.util.impl.XMLParser_impl.parse
> (XMLParser_impl.java:176)
> ... 22 more
>
> and I have no idea why. I have not edited the tutorial descriptor. And I
> can't remember if this is the first time I've tested this since upgrading!
>
> Any suggestions?
>
> Thanks,
>
> Maria
>