[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    [jira] [Created] (XMLBEANS-496) org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to
From:       "Adinarayana (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2013-01-11 0:58:12
Message-ID: JIRA.12627094.1357865888108.117083.1357865892633 () arcas
[Download RAW message or body]

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-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic