Adinarayana created XMLBEANS-496: ------------------------------------ Summary: org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to AttachmentType Key: XMLBEANS-496 URL: https://issues.apache.org/jira/browse/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:choice> <xsd:element name="UploadMetadata" type="AttachmentType" /> <xsd:element name="ExportMetadata" type="AttachmentType" /> </xsd:choice> <xsd:complexType name="AttachmentType"> <xsd:sequence> <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" /> </xsd:sequence> </xsd:complexType> 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: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: dev-h...@xmlbeans.apache.org