Hi

Thanks for all the detail in the mail below - that really helps - but I
think I need one more thing to repro the problem - the contents of the
file C:/Awsp/Scs/Mappingguide/3A9-R-C-POC/POCancelRequest-3A9.xml. Your
test code tries to read that file and I don't know what's in there.

If you could forward it that would be great.

Thanks,

Lawrence

> -----Original Message-----
> From: vramu_sg [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 30, 2006 1:58 AM
> To: dev@xmlbeans.apache.org
> Subject: Exception in thread "main" java.lang.ClassCastException:
> org.apache.xmlb
> 
> 
> I get the following error meesage when i use the xmlbeans scomp
command to
> produce the java files and jar file
> 
> D:\xmlbeans-2.1.0\bin\scomp
>
C:\Awsp\Scs\Mappingguide\Xsds\3A9_MS_V01_01_PurchaseOrderCancellationReq
ue
> st.xsd
> -src 3A9_R_C-POC\src -d 3A9_R_C-POC\classes -compiler
> C:\Jdk1.5.0_06\bin\javac -mx 1024M javasource 1.5 -out 3A9_R_C-POC.jar
> 
> This is my java code to access the xml file :
> 
> /**
>  *
>  */
> package pip3a9;
> 
> import java.io.File;
> import java.io.IOException;
> 
> import noNamespace.*;
> import noNamespace.Pip3A9PurchaseOrderCancellationRequestDocument.*;
> import noNamespace.PurchaseOrderCancellationDocument.*;
> 
> import noNamespace.impl.*;
> 
> import org.apache.xmlbeans.*;
> import org.apache.xmlbeans.impl.soap.*;
> 
> /**
>  * @author Administrator
>  *
>  */
> public class TestPip3a9 {
> 
>       /**
>        * @param args
>        */
>       public static void main(String[] args) {
> 
>               // TODO Auto-generated method stub
> 
>               File xis = new
> File("C:/Awsp/Scs/Mappingguide/3A9-R-C-POC/POCancelRequest-3A9.xml");
> 
>               //Bind the incoming XML to an XMLBeans type.
>               Pip3A9PurchaseOrderCancellationRequestDocument pocrDoc =
null;
>               Pip3A9PurchaseOrderCancellationRequest pocReq = null;
>               PartnerRoleDescription fromRole = null;
>               PurchaseOrderCancellation poc = null;
>               PartnerRoleDescription toRole = null;
>         try
>         {
>               pocrDoc =
> Pip3A9PurchaseOrderCancellationRequestDocument.Factory.parse(xis);
> 
>
System.out.println("Pip3A9PurchaseOrderCancellationRequestDocument
> Validation Result === " + pocrDoc.validate());
> 
> System.out.println("==========================================");
>             System.out.println(pocrDoc.toString());
>               pocReq =
pocrDoc.getPip3A9PurchaseOrderCancellationRequest();
>               fromRole = pocReq.getFromRole();
>               System.out.println("FromRole === " +
fromRole.toString());
> 
>               System.out.println("GlobalDocumentFunctionCode === " +
> pocReq.getGlobalDocumentFunctionCode());
>               poc = pocReq.getPurchaseOrderCancellation();
>               System.out.println("PurchaseOrderCancellationCode === "
+
> poc.getGlobalPurchaseOrderCancellationCode());
>               System.out.println("PurchaseOrderIdentifier === " +
>
poc.getPurchaseOrderIdentifier().getProprietaryDocumentIdentifier().toSt
ri
> ng());
>               System.out.println("RevisionNumber === " +
> poc.getRevisionNumber());
>               System.out.println("ThisDocumentGenerationDateTime === "
+
>
pocReq.getThisDocumentGenerationDateTime().getDateTimeStamp().toString()
);
>               System.out.println("ThisDocumentIdentifier === " +
>
pocReq.getThisDocumentIdentifier().getProprietaryDocumentIdentifier().to
St
> ring());
>               toRole = pocReq.getToRole();
>               System.out.println("ToRole === " + toRole.toString());
> 
>         }
>         catch (IOException e)
>         {
>             e.printStackTrace();
>         }
>         catch (XmlException e)
>         {
>             e.printStackTrace();
>         }
> 
> 
> 
> //System.out.println("==========================================");
> //System.out.println(pocReq.toString());
>       }
> 
> }
> 
> Exception in thread "main" java.lang.ClassCastException:
> org.apache.xmlbeans.impl.values.XmlComplexContentImpl
>       at
>
noNamespace.impl.Pip3A9PurchaseOrderCancellationRequestDocumentImpl.getP
ip
>
3A9PurchaseOrderCancellationRequest(Pip3A9PurchaseOrderCancellationReque
st
> DocumentImpl.java:36)
>       at pip3a9.TestPip3a9.main(TestPip3a9.java:45)
> 
> 
> This is my Schema .xsd file :
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
> 
>   RosettaNet XML Message Schema
>   3A9_MS_V01_01_PurchaseOrderCancellationRequest.dtd (02-Aug-02
1:52:20
> PM)
>   This document has been prepared by RosettaNet
> (http://www.rosettanet.org)
> from requirements gathered during the cluster/segment workshops and in
> conformance with the RosettaNet methodology.
> 
> -->
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
> elementFormDefault="qualified">
>   <xs:import namespace="http://www.w3.org/XML/1998/namespace";
> schemaLocation="xml.xsd"/>
>   <xs:element name="Pip3A9PurchaseOrderCancellationRequest">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:element ref="fromRole"/>
>         <xs:element minOccurs="0" ref="GlobalDocumentFunctionCode"/>
>         <xs:element ref="PurchaseOrderCancellation"/>
>         <xs:element ref="thisDocumentGenerationDateTime"/>
>         <xs:element ref="thisDocumentIdentifier"/>
>         <xs:element ref="toRole"/>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
>   <xs:element name="fromRole" type="PartnerRoleDescription"/>
>   <xs:complexType name="PartnerRoleDescription">
>     <xs:sequence>
>       <xs:element ref="PartnerRoleDescription"/>
>     </xs:sequence>
>   </xs:complexType>
>   <xs:element name="PartnerRoleDescription">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:element minOccurs="0" ref="ContactInformation"/>
>         <xs:element ref="GlobalPartnerRoleClassificationCode"/>
>         <xs:element ref="PartnerDescription"/>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
>   <xs:element name="ContactInformation">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:element ref="contactName"/>
>         <xs:element ref="EmailAddress"/>
>         <xs:element minOccurs="0" ref="facsimileNumber"/>
>         <xs:element ref="telephoneNumber"/>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
>   <xs:element name="contactName" type="FreeFormText"/>
>   <xs:complexType name="FreeFormText">
>     <xs:sequence>
>       <xs:element ref="FreeFormText"/>
>     </xs:sequence>
>   </xs:complexType>
>   <xs:element name="FreeFormText">
>     <xs:complexType mixed="true">
>       <xs:attributeGroup ref="attlist.FreeFormText"/>
>     </xs:complexType>
>   </xs:element>
>   <xs:attributeGroup name="attlist.FreeFormText">
>     <xs:attribute ref="xml:lang"/>
>   </xs:attributeGroup>
>   <xs:element name="EmailAddress" type="xs:string"/>
>   <xs:element name="facsimileNumber" type="CommunicationsNumber"/>
>   <xs:complexType name="CommunicationsNumber">
>     <xs:sequence>
>       <xs:element ref="CommunicationsNumber"/>
>     </xs:sequence>
>   </xs:complexType>
>   <xs:element name="CommunicationsNumber" type="xs:string"/>
>   <xs:element name="telephoneNumber" type="CommunicationsNumber"/>
>   <xs:element name="GlobalPartnerRoleClassificationCode"
> type="xs:string"/>
>   <xs:element name="PartnerDescription">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:element ref="BusinessDescription"/>
>         <xs:element ref="GlobalPartnerClassificationCode"/>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
>   <xs:element name="BusinessDescription">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:element ref="GlobalBusinessIdentifier"/>
>         <xs:element minOccurs="0" ref="GlobalSupplyChainCode"/>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
>   <xs:element name="GlobalBusinessIdentifier" type="xs:string"/>
>   <xs:element name="GlobalSupplyChainCode" type="xs:string"/>
>   <xs:element name="GlobalPartnerClassificationCode"
type="xs:string"/>
>   <xs:element name="GlobalDocumentFunctionCode" type="xs:string"/>
>   <xs:element name="PurchaseOrderCancellation">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:element minOccurs="0"
> ref="GlobalPurchaseOrderCancellationCode"/>
>         <xs:element ref="purchaseOrderIdentifier"/>
>         <xs:element minOccurs="0" ref="RevisionNumber"/>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
>   <xs:element name="GlobalPurchaseOrderCancellationCode"
> type="xs:string"/>
>   <xs:element name="purchaseOrderIdentifier"
> type="ProprietaryDocumentIdentifier"/>
>   <xs:complexType name="ProprietaryDocumentIdentifier">
>     <xs:sequence>
>       <xs:element ref="ProprietaryDocumentIdentifier"/>
>     </xs:sequence>
>   </xs:complexType>
>   <xs:element name="ProprietaryDocumentIdentifier" type="xs:string"/>
>   <xs:element name="RevisionNumber" type="xs:string"/>
>   <xs:element name="thisDocumentGenerationDateTime"
type="DateTimeStamp"/>
>   <xs:complexType name="DateTimeStamp">
>     <xs:sequence>
>       <xs:element ref="DateTimeStamp"/>
>     </xs:sequence>
>   </xs:complexType>
>   <xs:element name="DateTimeStamp" type="xs:string"/>
>   <xs:element name="thisDocumentIdentifier"
> type="ProprietaryDocumentIdentifier"/>
>   <xs:element name="toRole" type="PartnerRoleDescription"/>
> </xs:schema>
> 
> --
> View this message in context:
http://www.nabble.com/Exception-in-thread-
> %22main%22-java.lang.ClassCastException%3A-org.apache.xmlb-
> t1367527.html#a3667238
> Sent from the Xml Beans - Dev forum at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to