Kevin,

this should work out of the box. Can you show us a simplified example that allows us to replay your problem ? I'd like to see the classes you are using as domain objects, and the code you are using to (un-)marshal.

Regards
Werner

Peterson, Kevin J. [RO BMI] wrote:
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-type>

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(Unknown 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(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(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 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



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to