Java Mailing List Archive

http://www.junlu.com/

Home » user.castor »

[castor-user] Unable to find FieldDescriptor for 'ParameterDescription'

Papendieck, Thomas

2012-12-14


Author LoginPost Reply
Hello,

I'm using castor 1.3.2

when I try to unmarshal a XML I get this error:
testParseSampleXml(cpd.parser.XmlParserTest): could not convert customer XML file: Unable to find FieldDescriptor for 'ParameterDescription' in ClassDescriptor of Parameter.

It used to work until 3 days ago and I don't know what I changed to brake it. :o(

I already checked twice (Ho Ho Ho ;o)) that I used same castor version for source generation and in the project. I also regenerated the sources.
I even tried an older castor version (1.3.1) and the newest release (1.3.3-RC1) but no luck.

How do I fix this issue?

the XML is like this:
   <Parameter
      someAttributes="correctly parsed">
     <ParameterDescription>ParameterDescription
     </ParameterDescription>
     <!-- some more tags -->
  </Parameter>

My XSD looks like this:
<element
   name="ParameterDescription"
   type="string" />
<element
   name="Parameter">
   <complexType>
     <sequence>
       <element
         ref="cpd:ParameterDescription" />
    <!-- some more elements -->
  </complexType>
 </element>

the resulting 'Parameter' object looks like this:
public class Parameter implements java.io.Serializable {
  /**
  * Field _parameterDescription.
  */
  private java.lang.String _parameterDescription;
// more attributes

  /**
  * Returns the value of field 'parameterDescription'.
  *
  * @return the value of field 'ParameterDescription'.
  */
  public java.lang.String getParameterDescription(
  ) {
    return this._parameterDescription;
  }
// more methods

  /**
  * Sets the value of field 'parameterDescription'.
  *
  * @param parameterDescription the value of field
  * 'parameterDescription'.
  */
  public void setParameterDescription(
       final java.lang.String parameterDescription) {
    this._parameterDescription = parameterDescription;
  }
}

This is the call to the unmarshaller:
try {
       return (CustomerParameterDefinition) Unmarshaller.unmarshal(CustomerParameterDefinition.class, pFileReader);
    } catch (Exception ex) {
       throw new RuntimeException("could not convert customer XML file: "
            + ex.getMessage());
    }

bye
Thomas




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

  http://xircles.codehaus.org/manage_email


©2008 junlu.com - Jax Systems, LLC, U.S.A.