I'm trying to convert from Java object to XML and vice versa and I having two 
problems.

 1)When I marshal the Java object to XML, the mimeId and mimeDescription get set with 
the correct value but the mimeType is never set. 

 2)And when I tried to unmarshal, I get an error message with the mimeId.
    This is the error message I recieved:
      -->Error : java.lang.IllegalArgumentException: Type conversion error: could not 
set value mimeId(java.math.BigDecimal) with value of type java.lang.String

Could you let me know why the mimeType is not getting set with its value and why I'm 
getting this error message during the unmarshal process?


I have the following Java class and mapping file. 

Java class:

public class MimeType {
  
  private BigDecimal mimeId;
  private String mimeType;
  private String mimeDescription;

  public MimeType()
  {
    mimeId = null;
    mimeType = null;
    mimeDescription = null;
  }

  public BigDecimal getMimeId()
  {
    return mimeId;
  }

  public void setMimeId(BigDecimal id)
  {
    this.mimeId = id;
  }

  public String getMimeType()
  {
    return mimeType;
  }

  public void setMimeType(String type)
  {
    this.mimeType = type;
  }

  public String getMimeDescription()
  {
    return mimeDescription;
  }

  public void setMimeDescription(String mimeDesc)
  {
    this.mimeDescription = mimeDesc;
  }
}

Mapping file:

<mapping>

  <!--  Mapping for Mime Types  -->
  <class name="MimeType"
         identity="mimeId">
    <description>Mime types</description>
    <field name="mimeId" type="big-decimal" >
    </field>
    <field name="mimeType" type="string">
    </field>
    <field name="mimeDescription" type="string">
    </field>
  </class>

</mapping>
___________________________________________________________________________________

thanks you in advance,
Ide

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to