I have several Enums that I am trying to marshal/unmarshal for an Axis
web service with Castor 1.2. I am not using a mapping file.

Here is a code snippet from the class that contains the Enums:
...
public interface CodedNodeSet extends Serializable {

    public enum PropertyType { COMMENT, DEFINITION, INSTRUCTION,
PRESENTATION, GENERIC }
 ....

Marshalling PropertyType works fine and results in this XML:

<?xml version="1.0" encoding="UTF-8"?>
<coded-node-set$-property-type>PRESENTATION</coded-node-set$-property-ty
pe>

However, during Unmarshalling I get this error:

org.exolab.castor.xml.MarshalException: Element type "coded-node-set"
must be followed by either attribute specifications, ">" or "/>".{File:
[not available]; line: 2; column: 16}
        at
org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException
(Unmarshaller.java:761)
        at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:727)
        at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:616)
        at edu.mayo.cagrid.CastorUtil.<init>(CastorUtil.java:172)
        at edu.mayo.cagrid.CastorUtil.main(CastorUtil.java:83)
Caused by: org.xml.sax.SAXParseException: Element type "coded-node-set"
must be followed by either attribute specifications, ">" or "/>".
        at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unkno
wn Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
        at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(U
nknown Source)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRoot
ElementHook(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn 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
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:715)
        ... 3 more

Any ideas or help would be great!

-Thanks, Kevin

Reply via email to