Adinarayana created XMLBEANS-496:

             Summary: org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be 
cast to AttachmentType
                 Key: XMLBEANS-496
             Project: XMLBeans
          Issue Type: Bug
          Components: XmlObject
    Affects Versions: Version 2.5
         Environment: Jboss7 application serverver and windows XP environment
            Reporter: Adinarayana

I am getting above exception

here is my sample xsd e:
                                <xsd:element name="UploadMetadata" 
type="AttachmentType" />
                                <xsd:element name="ExportMetadata" 
type="AttachmentType" />

<xsd:complexType name="AttachmentType">
                        <xsd:element name="FileName" type="xsd:string" 
minOccurs="1" />
                        <xsd:element name="FileType" type="xsd:string" 
minOccurs="1" />
                        <xsd:element name="BinaryData" type="xsd:base64Binary"
                                minOccurs="1" />

it's failing in the following java code 

            AttachmentType attachmentType = null;

            if (upldMetadataReqType.isSetUploadMetadata()) {
//it's working for getUploadMetaData()
                attachmentType = upldMetadataReqType.getUploadMetadata();
            }else {

// getting the error when i am trying to access getExportmetadata()
                attachmentType = upldMetadataReqType.getExportMetadata();

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to