Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] best way to bind java classes to xom classes?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Steve Loughran <steve.loughran AT gmail.com>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] best way to bind java classes to xom classes?
  • Date: Mon, 20 Jun 2005 16:25:28 +0100

On 6/20/05, Elliotte Harold <elharo AT metalab.unc.edu> wrote:
> Steve Loughran wrote:
> > Now that I have refactored all my stuff to extend Xom elements, I am
> > encountering a new parser error on one of my test documents:
> >
> >
> > nu.xom.ParsingException: Additional namespace http://example.org/24
> > conflicts with existing namespace binding. at line -1, column -1.
> > at nu.xom.Builder.build(Builder.java:1138)
> >
>
> I'm not 100% sure. It's probably a bug in your code, but without a full
> tests case that's hard to tell.

I think that is quite possible, given that it worked until I
subclassed the elements. It also goes away when I take away the
xmlns="some namespace" declaration in the element itself.

> The line number where it's caught
> indicates that the ParsingException just wraps another exception, an
> XMLException. If you could unwrap that and print the nested exception's
> stack trace, that would tell us a little more.


The full junit trace is :
20-Jun-2005 16:20:48
org.smartfrog.test.unit.sfcore.languages.cdl.XmlTestBase log
INFO: test/cdl/invalid/wrong_doc_namespace.cdl
20-Jun-2005 16:20:48
org.smartfrog.test.unit.sfcore.languages.cdl.XmlTestBase log
INFO: expected [Cannot find the declaration of element 'cdl:cdl'] but
got nu.xom.ParsingException: Additional namespace
http://example.org/24 conflicts with existing namespace binding. at
line -1, column -1.

nu.xom.ParsingException: Additional namespace http://example.org/24
conflicts with existing namespace binding. at line -1, column -1.
at nu.xom.Builder.build(Builder.java:1138)
at nu.xom.Builder.build(Builder.java:586)
at
org.smartfrog.sfcore.languages.cdl.CdlParser.parseStream(CdlParser.java:105)
at
org.smartfrog.sfcore.languages.cdl.CdlParser.parseResource(CdlParser.java:120)
at
org.smartfrog.test.unit.sfcore.languages.cdl.XmlTestBase.load(XmlTestBase.java:88)
at
org.smartfrog.test.unit.sfcore.languages.cdl.XmlTestBase.assertInvalidCDL(XmlTestBase.java:141)
at
org.smartfrog.test.unit.sfcore.languages.cdl.XmlTestBase.assertInvalidCDL(XmlTestBase.java:122)
at
org.smartfrog.test.unit.sfcore.languages.cdl.CdlLoaderTest.testWrongDocNamespace(CdlLoaderTest.java:131)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at
com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
Caused by: nu.xom.NamespaceConflictException: Additional namespace
http://example.org/24 conflicts with existing namespace binding.
at nu.xom.Element.addNamespaceDeclaration(Element.java:1136)
at nu.xom.XOMHandler.startElement(XOMHandler.java:199)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at nu.xom.Builder.build(Builder.java:1121)
... 27 more


> On a related note, how do you print the above stack trace in the first
> place? Can I see those lines of code. I think ex.printStackTrace()
> should include the nested stack trace as well; but if it's not doing
> that (and it might not be) I should be able to fix that.

junit is doing the printing, via the IDE. Its not really in my hands.




Archive powered by MHonArc 2.6.24.

Top of Page