castor

marshalling inner class causes INVALID_CHARACTER_ERR when only parent class is defined in marshalling file

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.3
  • Fix Version/s: None
  • Component/s: XML
  • Labels:
    None
  • Environment:
    Linux, Java 1.6.0_16
  • Number of attachments :
    0

Description

Using the following mapping:
<class name="test.AbstractResultBean" auto-complete="false" verify-constructable="false">
<map-to xml="resultBean" />
<field name="result" />
</class>

and trying to marshal the following INNER class:
public static class ServerResult extends AbstractResultBean {
}

I get the following error:

org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkQName(CoreDocumentImpl.java:2571)
at com.sun.org.apache.xerces.internal.dom.ElementNSImpl.setName(ElementNSImpl.java:117)
at com.sun.org.apache.xerces.internal.dom.ElementNSImpl.<init>(ElementNSImpl.java:80)
at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElementNS(CoreDocumentImpl.java:2084)
at org.springframework.xml.dom.DomContentHandler.startElement(DomContentHandler.java:77)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:1634)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:914)
at org.springframework.oxm.castor.CastorMarshaller.marshal(CastorMarshaller.java:332)
at org.springframework.oxm.castor.CastorMarshaller.marshalSaxHandlers(CastorMarshaller.java:307)
at org.springframework.oxm.castor.CastorMarshaller.marshalDomNode(CastorMarshaller.java:300)
at org.springframework.oxm.AbstractMarshaller.marshalDomResult(AbstractMarshaller.java:192)
at org.springframework.oxm.AbstractMarshaller.marshal(AbstractMarshaller.java:88)
at com.gs.configmgt.proteus.view.BasicStatusView.toXML(BasicStatusView.java:65)

The error appears for inner classes only. Normal top level classes work fine with this mapping.

Activity

Hide
Kevin Schmidt added a comment -

Also, as far as I know, this worked without problems in version 1.2.

Show
Kevin Schmidt added a comment - Also, as far as I know, this worked without problems in version 1.2.
Hide
Werner Guttmann added a comment -

Kevin, can you please attach a fully-working (JUnit-based) test case that we can you to replicate the problem at hand ?

Show
Werner Guttmann added a comment - Kevin, can you please attach a fully-working (JUnit-based) test case that we can you to replicate the problem at hand ?

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: