Unexpected root element

I am having some trouble unmarshalling an xml document using JAXB 1.0. I am getting the error unexpected root element. Can someone please tell me what causes this? The root element of the document I'm trying to unmarshall matches the schema root element. I have exhausted all resources, and have hit a wall. Please help. I can post the source code, schema and xml document at your request.
Thank you.

Thank you for you reply. Here is all the info below:
schema file:
<?xml version="1.0"?>
<!-- edited with XML Spy v4.3 U (http://www.xmlspy.com) by Henry C. Octapod (Obermeyer's Insurance) -->
<xs:schema targetNamespace="schemas/v1.01/TIMA_REQUEST.xsd" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:TIMA_XML="schemas/v1.01/TIMA_REQUEST.xsd" elementFormDefault="qualified" id="TIMA_REQUEST">
     <xs:element name="TIMAREQUEST">
          <xs:annotation>
               <xs:documentation>The Root element for all TIMA requests and responses. Contains the TIMA_XML_VERSION attribute, which, must be set to teh release version of the Schema in use (Currently "1.1")</xs:documentation>
          </xs:annotation>
          <xs:complexType>
               <xs:sequence>
                    <xs:element name="REQUEST_INFO">
                         <xs:annotation>
                              <xs:documentation>This element contains all the basic information about the request itself, such as the subscriber, any inventory items requested and their type, etc.</xs:documentation>
                         </xs:annotation>
                         <xs:complexType>
                              <xs:sequence>
                                   <xs:element name="SUBSCRIBER" type="xs:positiveInteger" minOccurs="0">
                                        <xs:annotation>
                                             <xs:documentation>The unique TIMA Subscriber ID of the subscriber making this request.</xs:documentation>
                                        </xs:annotation>
                                   </xs:element>
                                   <xs:element name="INVENTORY_ITEM" maxOccurs="unbounded">
                                        <xs:annotation>
                                             <xs:documentation>One(1) or more elements containing the TIMA Inventory Item IDs and TIMA Inventory Type Codes representing one or more Inventory items to be processed for this request. This element may also contain subscriber supplied "SUPPLIER" elements for use in filtering the rates returned.</xs:documentation>
                                        </xs:annotation>
                                        <xs:complexType>
                                             <xs:sequence>
                                                  <xs:element name="SUPPLIER" minOccurs="0" maxOccurs="unbounded">
                                                       <xs:annotation>
                                                            <xs:documentation>0 or more supplier tags. The SUPPLIER element is use to normalize between the TIMA ID and the Supplier's UNIQUE ID and is optional for the Subscriber. If the subscriber chooses to, they may include the SUPPLIER elements as part of their request. The TIMA system will then use the EXCLUDED attribute to control which suppliers to request. inventory from.</xs:documentation>
                                                       </xs:annotation>
                                                       <xs:complexType>
                                                            <xs:attribute name="INVENTORY_ID" type="xs:string" form="unqualified">
                                                                 <xs:annotation>
                                                                      <xs:documentation>The Unique ID of this Inventory Item, in the Supplier's System (See "SUPPLIER_ID" below). </xs:documentation>
                                                                 </xs:annotation>
                                                            </xs:attribute>
                                                            <xs:attribute name="EXCLUDED" type="xs:boolean" use="optional" form="unqualified">
                                                                 <xs:annotation>
                                                                      <xs:documentation>True/False. Whether or not to exclude this supplier, for this property.</xs:documentation>
                                                                 </xs:annotation>
                                                            </xs:attribute>
                                                            <xs:attribute name="SUPPLIER_ID" type="xs:positiveInteger">
                                                                 <xs:annotation>
                                                                      <xs:documentation>The Unique TIMA Member ID of the supplier to whom this inventory ID belongs.</xs:documentation>
                                                                 </xs:annotation>
                                                            </xs:attribute>
                                                       </xs:complexType>
                                                  </xs:element>
                                             </xs:sequence>
                                             <xs:attribute name="CODE" type="xs:string" form="unqualified">
                                                  <xs:annotation>
                                                       <xs:documentation>The Unique TIMA ID of the inventory Item</xs:documentation>
                                                  </xs:annotation>
                                             </xs:attribute>
                                             <xs:attribute name="INVENTORY_TYPE" type="xs:integer">
                                                  <xs:annotation>
                                                       <xs:documentation>Integer value specifing what type of inventory which is being requested. For example, if a subscriber seeks hotel rooms then they would use "2" .</xs:documentation>
                                                  </xs:annotation>
                                             </xs:attribute>
                                        </xs:complexType>
                                   </xs:element>
                              </xs:sequence>
                              <xs:attribute name="REQUEST_TYPE" type="xs:string">
                                   <xs:annotation>
                                        <xs:documentation>A String containing the type of transaction to be processed. See Appendix "Transaction Types")</xs:documentation>
                                   </xs:annotation>
                              </xs:attribute>
                         </xs:complexType>
                    </xs:element>
                    <xs:element name="REQUEST_DATA">
                         <xs:annotation>
                              <xs:documentation>Contains all sub-elements which define this request's data.</xs:documentation>
                         </xs:annotation>
                         <xs:complexType>
                              <xs:sequence>
                                   <xs:element name="CANCEL_INFO" minOccurs="0">
                                        <xs:annotation>
                                             <xs:documentation>The element used in all transaction cancellation requests. This element is dependent on information previously aqueired from a succesful ORDER_ITEM transaction.</xs:documentation>
                                        </xs:annotation>
                                        <xs:complexType>
                                             <xs:sequence>
                                                  <xs:element name="TIMA_TRANSACTION_ID" type="xs:positiveInteger">
                                                       <xs:annotation>
                                                            <xs:documentation>TIMA TransactionID as returned in the TRANSACTION_DATA element by a successful ORDER_ITEM transaction. </xs:documentation>
                                                       </xs:annotation>
                                                  </xs:element>
                                                  <xs:element name="CONFIRMATION_CODE" type="xs:positiveInteger">
                                                       <xs:annotation>
                                                            <xs:documentation>Confirmation code as returned in the TRANSACTION_DATA element by a successful ORDER_ITEM transaction. </xs:documentation>
                                                       </xs:annotation>
                                                  </xs:element>
                                             </xs:sequence>
                                        </xs:complexType>
                                   </xs:element>
                                   <xs:element name="ORDER_INFO" minOccurs="0" maxOccurs="unbounded">
                                        <xs:annotation>
                                             <xs:documentation>The Root element for all transactions requesting rates or booking. This element always contains the Custom element for the inventory type.</xs:documentation>
                                        </xs:annotation>
                                        <xs:complexType>
                                             <xs:sequence>
                                                  <xs:element name="HOTEL_INFO" minOccurs="0">
                                                       <xs:annotation>
                                                            <xs:documentation>Custome Element for inventory type two (2). The Hotel Info Element. Used when requesting information about hotel rates and availability.</xs:documentation>
                                                       </xs:annotation>
                                                       <xs:complexType>
                                                            <xs:sequence>
                                                                 <xs:element name="RATE_CODE" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>(optional) Supplier-Specific code for this room and rate. As returned from the supplier in the REQUEST_RATE_DETAILS response.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="INDATE" type="xs:date" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>The checkin date requested for this transaction.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="OUTDATE" type="xs:date" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>The checkout date requested for this transaction.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="ROOMS" type="xs:positiveInteger" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Number of rooms requested in this transaction.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="ADULTS" type="xs:positiveInteger" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Number of adults requested in this transaction.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="CHILDREN" type="xs:positiveInteger" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Number of children included in this stay.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="NATIVE_CURRENCY" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>The native currency code of the supplier or inventory locations (such as a Hotel in France). </xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="SMOKING" type="xs:boolean" minOccurs="0" maxOccurs="unbounded">
                                                                      <xs:annotation>
                                                                           <xs:documentation>True/False. Does the guest want a smoking room(s)</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="GUEST" maxOccurs="unbounded">
                                                                      <xs:annotation>
                                                                           <xs:documentation>One(1) to ADULTS guest elements. The first GUEST element will usually be the same as the PAYMENT_DATA (FIRST_NAME, LAST_NAME)</xs:documentation>
                                                                      </xs:annotation>
                                                                      <xs:complexType>
                                                                           <xs:sequence>
                                                                                <xs:element name="GUEST_REQUESTS" type="xs:string" minOccurs="0">
                                                                                     <xs:annotation>
                                                                                          <xs:documentation>Any specific requests the guest would like to make. </xs:documentation>
                                                                                     </xs:annotation>
                                                                                </xs:element>
                                                                           </xs:sequence>
                                                                           <xs:attribute name="FIRST_NAME" type="xs:string" use="required"/>
                                                                           <xs:attribute name="LAST_NAME" type="xs:string" use="required"/>
                                                                           <xs:attribute name="INITIAL" type="xs:string" use="optional"/>
                                                                      </xs:complexType>
                                                                 </xs:element>
                                                            </xs:sequence>
                                                       </xs:complexType>
                                                  </xs:element>
                                                  <xs:element name="PAYMENT_DATA" minOccurs="0">
                                                       <xs:annotation>
                                                            <xs:documentation>Element Containing all the credit card information neccesary to complete the transaction. USED ONLY FOR THE ORDER_ITEM REQUEST.</xs:documentation>
                                                       </xs:annotation>
                                                       <xs:complexType>
                                                            <xs:sequence>
                                                                 <xs:element name="FIRST_NAME" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>First name of the payee as listed on the credit card.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="LAST_NAME" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Last name of the payee as listed on the credit card.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="BILL_ADDRESS" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Striing containg payee's Address. May be multiple lines (sepreated by CR/LF).</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="BILL_CITY" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Striing containg payee's address-city name.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="BILL_STATE" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Striing containg payee's two(2) leter state code or Province name (US or international).</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="BILL_COUNTRY" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Striing containg payee's country code.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="BILL_ZIP" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Striing containg payee's zip or postal code (US or international).</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="BILL_PHONE" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Contact Phone for the payee (credit card holder). </xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="CREDIT_CARD_TYPE" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>The two (2) letter Credit Card Code (see appendix) specifying the type of card used for payment.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="CREDIT_NUMBER" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>The Credit Card Number on the payee's credit card.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="CREDIT_EXPIRE_MONTH" type="xs:gMonth" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>The expiration month on the payee's credit card.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="CREDIT_EXPIRE_YEAR" type="xs:gYear" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>The expiration year on the payee's credit card.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                            </xs:sequence>
                                                       </xs:complexType>
                                                  </xs:element>
                                                  <xs:element name="TRANSACTION_DATA">
                                                       <xs:annotation>
                                                            <xs:documentation>Information used to inform the TIMA system about the transaction being requested, or in the case of a successful response message, the amounts actually charged.</xs:documentation>
                                                       </xs:annotation>
                                                       <xs:complexType>
                                                            <xs:sequence>
                                                                 <xs:element name="DATETIMESTAMP" type="xs:dateTime" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Datetime stamp indicating the subscriber's time the transaction was submitted.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="NATIVE_CURRENCY" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>The native currency code of the supplier or inventory locations (such as a Hotel in France). </xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="PAYMENT_CURRENCY" type="xs:string" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>The currency code in which the payment should be made. For versions 1.1 and below, this value is always "USD".</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="WHOLESALE_RATE" type="xs:double" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>The rate/cost at which the supplier has aquired the inventory as returned from the supplier in the REQUEST_RATE_DETAILS response.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="RESALE_RATE" type="xs:double" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>The Displayable retail rate or cost for the transaction as returned from the supplier in the REQUEST_RATE_DETAILS response.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="GROSS_SALE" type="xs:double" minOccurs="0">
                                                                      <xs:annotation>
                                                                           <xs:documentation>This is the retail rate including any supplier taxes and/or fees as returned from the supplier in the REQUEST_RATE_DETAILS response.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="FEES" type="xs:double" minOccurs="0" msdata:Caption="Any Fees for this request, as returned by the supplier's reply to the REQUEST_RATE_COST_DETAILS transaction.">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Total supplier fees for the ORDER_ITEM transaction as returned from the supplier in the REQUEST_RATE_DETAILS response.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="TAXES" type="xs:double" minOccurs="0" msdata:Caption="Any Taxes for this request, as returned by the supplier's reply to the REQUEST_RATE_COST_DETAILS transaction.">
                                                                      <xs:annotation>
                                                                           <xs:documentation>Total supplier taxes for the ORDER_ITEM transaction as returned from the supplier in the REQUEST_RATE_DETAILS response.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="CANCELLATION_POLICY" type="xs:string" minOccurs="0" msdata:Caption="String containing the Cancellation Policy as defined by the Supplier Reply to REQUEST_RATE_COST_DETAILS">
                                                                      <xs:annotation>
                                                                           <xs:documentation>String containing the cancellation policy as returned from the supplier in the REQUEST_RATE_DETAILS response.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                                 <xs:element name="SUBSCRIBER_CHARGE" type="xs:double" minOccurs="0" msdata:Caption="Any additional fees the subscriber would like to add to the ORDER_ITEM Transaction">
                                                                      <xs:annotation>
                                                                           <xs:documentation>USD Monentary value of any additional charges the subscriber would like to add to an ORDER_ITEM request.</xs:documentation>
                                                                      </xs:annotation>
                                                                 </xs:element>
                                                            </xs:sequence>
                                                       </xs:complexType>
                                                  </xs:element>
                                             </xs:sequence>
                                        </xs:complexType>
                                   </xs:element>
                              </xs:sequence>
                         </xs:complexType>
                    </xs:element>
               </xs:sequence>
               <xs:attribute name="TIMA_XML_VERSION" type="xs:string" use="required" form="unqualified">
                    <xs:annotation>
                         <xs:documentation>TIMA XML Schema Version.. Curently: "1.1"</xs:documentation>
                    </xs:annotation>
               </xs:attribute>
          </xs:complexType>
     </xs:element>
</xs:schema>
xml input file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TIMAREQUEST TIMA_XML_VERSION="1.1" xmlns:ns1="schemas/v1.01/TIMA_REQUEST.xsd">
     <REQUEST_INFO REQUEST_TYPE="2">
          <SUBSCRIBER>7</SUBSCRIBER>
          <INVENTORY_ITEM INVENTORY_TYPE="2" CODE="123"/>
     </REQUEST_INFO>
     <REQUEST_DATA>
          <ORDER_INFO>
               <HOTEL_INFO>
                    <INDATE>2003-03-11</INDATE>
                    <OUTDATE>2003-03-11</OUTDATE>
                    <ROOMS>3</ROOMS>
                    <ADULTS>2</ADULTS>
                    <CHILDREN>1</CHILDREN>
               </HOTEL_INFO>
               <TRANSACTION_DATA/>
          </ORDER_INFO>
     </REQUEST_DATA>
</TIMAREQUEST>
test program:
package test;
* Test.java
* Version information
* Mar 11, 2003 5:36:46 PM
* Copyright notice
* @author cboyd
* @version
public class Test extends TestCase {
     * Constructor for Test.
     * @param arg0
     public Test(String arg0) {
          super(arg0);
     public void testUnmarshall() {
          try {
               JAXBContext context = JAXBContext.newInstance("test");
               Unmarshaller unmarshaller = context.createUnmarshaller();
               unmarshaller.unmarshal(new java.io.FileInputStream("TIMAREQUEST.xml"));
          } catch (JAXBException e) {
               fail("failed to unmarshall: " + e.getMessage());
          } catch (Throwable e) {
               fail("failed to unmarshall: " + e.getMessage());
Thank you.

Similar Messages

  • Dreaded "unexpect root element" exception

    For some reason, most of my subject was cutoff from my previous topic posting:
    Anyway, here is my stack trace:
    org.xml.sax.SAXParseException: unexpected root element (uri:"", local:"CancelPenalty"). Expected elements are
         at generated.impl.runtime.SAXUnmarshallerHandlerImpl.startElement(SAXUnmarshallerHandlerImpl.java:113)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
         at generated.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:140)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:131)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:178)
         at populateDB.Populate.getCancelPenalty(Populate.java:26)
         at populateDB.Populate.main(Populate.java:13)
    --------------- linked to ------------------
    javax.xml.bind.UnmarshalException
    - with linked exception:
    [org.xml.sax.SAXParseException: unexpected root element (uri:"", local:"CancelPenalty"). Expected elements are ]
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:298)
         at generated.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:144)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:131)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:178)
         at populateDB.Populate.getCancelPenalty(Populate.java:26)
         at populateDB.Populate.main(Populate.java:13)
    Here are XSD and XML files:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XMLSpy v2007 (http://www.altova.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="CancelPenalty">
    <xs:sequence>
    <xs:element name="SKUGroupCancelPolicySetID" type="xs:int"/>
    <xs:element name="CancelPenaltyDefaultBool" type="xs:boolean"/>
    <xs:element name="CancelPenaltyHourCnt" type="xs:int"/>
    <xs:element name="CancelPenaltyLogID" type="xs:int"/>
    <xs:element name="CancelPenaltyCostAmt" type="xs:float"/>
    <xs:element name="CancelPenaltyCostRate" type="xs:float"/>
    <xs:element name="CancelPenaltyCostDayCnt" type="xs:int"/>
    <xs:element name="CancelPenaltyPriceAmt" type="xs:float"/>
    <xs:element name="CancelPenaltyPriceRate" type="xs:float"/>
    <xs:element name="CancelPenaltyPriceDayCnt" type="xs:int"/>
    <xs:element name="UpdateTPID" type="xs:int"/>
    <xs:element name="UpdateTUID" type="xs:int"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    ?xml version="1.0" encoding="UTF-8" ?>
    <CancelPenalty>
    <SKUGroupCancelPolicySetID>27950</SKUGroupCancelPolicySetID>
    <CancelPenaltyDefaultBool>1</CancelPenaltyDefaultBool>
    <CancelPenaltyHourCnt>0</CancelPenaltyHourCnt>
    <CancelPenaltyLogID>1211679</CancelPenaltyLogID>
    <CancelPenaltyCostAmt>0</CancelPenaltyCostAmt>
    <CancelPenaltyCostRate>.0000</CancelPenaltyCostRate>
    <CancelPenaltyCostDayCnt>0</CancelPenaltyCostDayCnt>
    <CancelPenaltyPriceAmt>0</CancelPenaltyPriceAmt>
    <CancelPenaltyPriceRate>1.0000</CancelPenaltyPriceRate>
    <CancelPenaltyPriceDayCnt>0</CancelPenaltyPriceDayCnt>
    <UpdateTPID>20001</UpdateTPID>
    <UpdateTUID>49627832</UpdateTUID>
    </CancelPenalty>
    And my main program:
    public static void getCancelPenalty() {
    String jaxbContext = "generated";
    String cancelPenaltyFilename = "CancelPenaltyOne.xml";
    JAXBContext jc = null;
    Unmarshaller u = null;
    CancelPenaltyImpl cancelPenalty = null;
    try {
    jc = JAXBContext.newInstance(jaxbContext);
    u = jc.createUnmarshaller();
    cancelPenalty = (CancelPenaltyImpl) u.unmarshal(
    new FileInputStream(cancelPenaltyFilename));
    } catch (Exception e) {
    e.printStackTrace();
    System.exit(0);
    int updateTUID = cancelPenalty.getUpdateTUID();
    System.out.println("These values were retrieved from " +
    "the Cancel Penalty object:");
    System.out.println("UpdateTUID: "+ updateTUID);
    }

    I simplified my schema and xml file to be:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XMLSpy v2007 (http://www.altova.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="CancelPenalty">
    <xs:sequence>
    <xs:element name="UpdateTUID" type="xs:int"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    <?xml version="1.0" encoding="UTF-8" ?>
    <CancelPenalty>
    <UpdateTUID>1</UpdateTUID>
    </CancelPenalty>
    Appreciate any help on this.
    Matthew

  • JAXB unmarshal exception "unexpected root element"

    I have a very simple xsd and just one xml file I am trying to unmarshal. I switched to jws-2.0 and am still getting the same exception I go when using jws-1.5. I would be very grateful for any assistance on this:
    Here is my main program:
    public static void main(String[] args) {
    getCancelPenalty();
    public static void getCancelPenalty() {
    String jaxbContext = "generated";
    String cancelPenaltyFilename = "CancelPenaltyOne.xml";
    JAXBContext jc = null;
    Unmarshaller u = null;
    CancelPenalty cancelPenalty = null;
    try {
    jc = JAXBContext.newInstance(jaxbContext);
    u = jc.createUnmarshaller();
    cancelPenalty = (CancelPenalty) u.unmarshal(
    new FileInputStream(cancelPenaltyFilename));
    } catch (Exception e) {
    e.printStackTrace();
    System.exit(0);
    int updateTUID = cancelPenalty.getUpdateTUID();
    System.out.println("These values were retrieved from " +
    "the Cancel Penalty object:");
    System.out.println("UpdateTUID: "+ updateTUID);
    Here is my xsd file:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:complexType name="CancelPenalty">
    <xsd:sequence>
    <xsd:element name="UpdateTUID" type="xsd:int"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    Here is my xml file that i am trying to parse:
    <?xml version="1.0" encoding="UTF-8"?>
    <CancelPenalty>
    <UpdateTUID>1</UpdateTUID>
    </CancelPenalty>
    And finally here is stack trace of exception:
    javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"CancelPenalty"). Expected elements are (unknown)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:523)
         at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:199)
         at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:194)
         at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:71)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:920)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:364)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:345)
         at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:117)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:200)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:173)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:184)
         at populateDB.Populate.getCancelPenalty(Populate.java:28)
         at populateDB.Populate.main(Populate.java:15)
    Any ideas what is going awry?

    Solved:
    My xsd file was incorrect (I guess):
    instead of:
         <xs:complexType name="CancelPenalty">
    I needed to use:
         <xsd:element name="CancelPenalty">
              <xsd:complexType>
    Not sure why the first construct is incorrect, but I found another example of an xsd file that used the second construct and it worked for me as well.

  • Caused by: oracle.xdo.parser.v2.XMLParseException: Start of root element ex

    Hello
    I am new to XML and I have written an XML Data template from scratch (not from .rdf). It's a very basic sql statement that returns 4 pieces of data to print on file folder labels.
    The results look great in Template preview mode. However, when I run the concurrent program thru the applications, I am getting the error below.
    The first run actually completed successfully but returned no rows. I believe that is because I am using a view in my sql statement and unless you have set a multi-org variable, you return no rows. So, I created a package with one beforeReport trigger that sets the multi-org variable.
    The second time I ran the concurrent program, it finished in error. I'm not sure where this error is pointing me. Is it a problem with my trigger? Or did it return rows and I have an issue with my layout template?
    Thank you
    Eileen
    [11/7/08 1:05:57 PM] [UNEXPECTED] [816668:RT9640187] java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeParse(XSLT10gR1.java:517)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:224)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:177)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:1044)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:997)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:212)
         at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1657)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:967)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5888)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3438)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3527)
         at oracle.apps.fnd.cp.opp.XMLPublisherProcessor.process(XMLPublisherProcessor.java:247)
         at oracle.apps.fnd.cp.opp.OPPRequestThread.run(OPPRequestThread.java:157)
    Caused by: oracle.xdo.parser.v2.XMLParseException: Start of root element expected.
         at oracle.xdo.parser.v2.XMLError.flushErrors1(XMLError.java:324)
         at oracle.xdo.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:319)
         at oracle.xdo.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:281)
         at oracle.xdo.parser.v2.XMLParser.parse(XMLParser.java:266)

    Hi,
    Can you please tell me wat the problem was?
    Because even I am getting the same error msg..
    Thanks.
    Vignesh

  • "unexpected reference element " error,who can help me?:(

    hi all:
    I am using Jpub tools,I created a webservices client and its PL/SQL wrapper,all are success,but when i test the function in sqlplus,I get a error:
    oracle.j2ee.ws.common.encoding.DeserializationException:unexpected reference element during Deserialization;the element "result" is not defined as a referenceable type
    I traced the response message as follow:
    <?xml version="1.0" encoding="utf-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <ns1:setUserPasswordResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://lcimsforuserinfo.webservice.lcbms.linkage.com">
    <setUserPasswordReturn href="#id0"/>
    </ns1:setUserPasswordResponse>
    <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:SetUserPasswordResponse" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://lcimsforuserinfo.webservice.lcbms.linkage.com">
    <errorDescription xsi:type="soapenc:string">password modify success!</errorDescription>
    <result href="#id1"/>
    </multiRef>
    <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
    </soapenv:Body>
    </soapenv:Envelope>
    i found the service was successfull executed,so I supect this client can not support the format:"multiRef"....but i don't know how to do........
    who can help me!!
    My WSDL as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="http://lcimsforuserinfo.webservice.lcbms.linkage.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://lcimsforuserinfo.webservice.lcbms.linkage.com" xmlns:intf="http://lcimsforuserinfo.webservice.lcbms.linkage.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <!--WSDL created by Apache Axis version: 1.3
    Built on Oct 05, 2005 (05:23:37 EDT)-->
    <wsdl:types>
    <Schema targetNamespace="http://lcimsforuserinfo.webservice.lcbms.linkage.com" xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    <complexType name="GetUserInfoRequest">
    <sequence>
    <element name="servicetype" type="xsd:int"/>
    <element name="username" nillable="true" type="soapenc:string"/>
    </sequence>
    </complexType>
    <complexType name="GetUserInfoResponse">
    <sequence>
    <element name="errorDescription" nillable="true" type="soapenc:string"/>
    <element name="result" type="xsd:int"/>
    <element name="userInfoXML" nillable="true" type="soapenc:string"/>
    </sequence>
    </complexType>
    <complexType name="GetUserDetRequest">
    <sequence>
    <element name="beginTime" nillable="true" type="soapenc:string"/>
    <element name="endTime" nillable="true" type="soapenc:string"/>
    <element name="servicetype" type="xsd:int"/>
    <element name="username" nillable="true" type="soapenc:string"/>
    </sequence>
    </complexType>
    <complexType name="GetUserDetResponse">
    <sequence>
    <element name="errorDescription" nillable="true" type="soapenc:string"/>
    <element name="result" type="xsd:int"/>
    <element name="userDetXML" nillable="true" type="soapenc:string"/>
    </sequence>
    </complexType>
    <complexType name="GetAuthFailRequest">
    <sequence>
    <element name="authDate" nillable="true" type="soapenc:string"/>
    <element name="servicetype" type="xsd:int"/>
    <element name="username" nillable="true" type="soapenc:string"/>
    </sequence>
    </complexType>
    <complexType name="GetAuthFailResponse">
    <sequence>
    <element name="authFailXML" nillable="true" type="soapenc:string"/>
    <element name="errorDescription" nillable="true" type="soapenc:string"/>
    <element name="result" type="xsd:int"/>
    </sequence>
    </complexType>
    <complexType name="GetUserOnlineRequest">
    <sequence>
    <element name="servicetype" type="xsd:int"/>
    <element name="username" nillable="true" type="soapenc:string"/>
    </sequence>
    </complexType>
    <complexType name="GetUserOnlineResponse">
    <sequence>
    <element name="errorDescription" nillable="true" type="soapenc:string"/>
    <element name="result" type="xsd:int"/>
    <element name="userOnlineXML" nillable="true" type="soapenc:string"/>
    </sequence>
    </complexType>
    <complexType name="SetUserPasswordRequest">
    <sequence>
    <element name="admin" nillable="true" type="soapenc:string"/>
    <element name="password" nillable="true" type="soapenc:string"/>
    <element name="servicetype" type="xsd:int"/>
    <element name="username" nillable="true" type="soapenc:string"/>
    </sequence>
    </complexType>
    <complexType name="SetUserPasswordResponse">
    <sequence>
    <element name="errorDescription" nillable="true" type="soapenc:string"/>
    <element name="result" type="xsd:int"/>
    </sequence>
    </complexType>
    </schema>
    </wsdl:types>
    <wsdl:message name="setUserPasswordResponse">
    <wsdl:part name="setUserPasswordReturn" type="impl:SetUserPasswordResponse"/>
    </wsdl:message>
    <wsdl:message name="getUserInfoRequest">
    <wsdl:part name="in0" type="impl:GetUserInfoRequest"/>
    </wsdl:message>
    <wsdl:message name="getUserOnlineRequest">
    <wsdl:part name="in0" type="impl:GetUserOnlineRequest"/>
    </wsdl:message>
    <wsdl:message name="getAuthFailResponse">
    <wsdl:part name="getAuthFailReturn" type="impl:GetAuthFailResponse"/>
    </wsdl:message>
    <wsdl:message name="getUserInfoResponse">
    <wsdl:part name="getUserInfoReturn" type="impl:GetUserInfoResponse"/>
    </wsdl:message>
    <wsdl:message name="getUserDetResponse">
    <wsdl:part name="getUserDetReturn" type="impl:GetUserDetResponse"/>
    </wsdl:message>
    <wsdl:message name="getUserOnlineResponse">
    <wsdl:part name="getUserOnlineReturn" type="impl:GetUserOnlineResponse"/>
    </wsdl:message>
    <wsdl:message name="getUserDetRequest">
    <wsdl:part name="in0" type="impl:GetUserDetRequest"/>
    </wsdl:message>
    <wsdl:message name="setUserPasswordRequest">
    <wsdl:part name="in0" type="impl:SetUserPasswordRequest"/>
    </wsdl:message>
    <wsdl:message name="getAuthFailRequest">
    <wsdl:part name="in0" type="impl:GetAuthFailRequest"/>
    </wsdl:message>
    <wsdl:portType name="LcimsForUserInfo">
    <wsdl:operation name="getUserInfo" parameterOrder="in0">
    <wsdl:input message="impl:getUserInfoRequest" name="getUserInfoRequest"/>
    <wsdl:output message="impl:getUserInfoResponse" name="getUserInfoResponse"/>
    </wsdl:operation>
    <wsdl:operation name="getUserDet" parameterOrder="in0">
    <wsdl:input message="impl:getUserDetRequest" name="getUserDetRequest"/>
    <wsdl:output message="impl:getUserDetResponse" name="getUserDetResponse"/>
    </wsdl:operation>
    <wsdl:operation name="getAuthFail" parameterOrder="in0">
    <wsdl:input message="impl:getAuthFailRequest" name="getAuthFailRequest"/>
    <wsdl:output message="impl:getAuthFailResponse" name="getAuthFailResponse"/>
    </wsdl:operation>
    <wsdl:operation name="getUserOnline" parameterOrder="in0">
    <wsdl:input message="impl:getUserOnlineRequest" name="getUserOnlineRequest"/>
    <wsdl:output message="impl:getUserOnlineResponse" name="getUserOnlineResponse"/>
    </wsdl:operation>
    <wsdl:operation name="setUserPassword" parameterOrder="in0">
    <wsdl:input message="impl:setUserPasswordRequest" name="setUserPasswordRequest"/>
    <wsdl:output message="impl:setUserPasswordResponse" name="setUserPasswordResponse"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="LcimsForUserInfoSoapBinding" type="impl:LcimsForUserInfo">
    <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getUserInfo">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="getUserInfoRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://lcimsforuserinfo.webservice.lcbms.linkage.com" use="encoded"/>
    </wsdl:input>
    <wsdl:output name="getUserInfoResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://lcimsforuserinfo.webservice.lcbms.linkage.com" use="encoded"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getUserDet">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="getUserDetRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://lcimsforuserinfo.webservice.lcbms.linkage.com" use="encoded"/>
    </wsdl:input>
    <wsdl:output name="getUserDetResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://lcimsforuserinfo.webservice.lcbms.linkage.com" use="encoded"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getAuthFail">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="getAuthFailRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://lcimsforuserinfo.webservice.lcbms.linkage.com" use="encoded"/>
    </wsdl:input>
    <wsdl:output name="getAuthFailResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://lcimsforuserinfo.webservice.lcbms.linkage.com" use="encoded"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getUserOnline">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="getUserOnlineRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://lcimsforuserinfo.webservice.lcbms.linkage.com" use="encoded"/>
    </wsdl:input>
    <wsdl:output name="getUserOnlineResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://lcimsforuserinfo.webservice.lcbms.linkage.com" use="encoded"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="setUserPassword">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="setUserPasswordRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://lcimsforuserinfo.webservice.lcbms.linkage.com" use="encoded"/>
    </wsdl:input>
    <wsdl:output name="setUserPasswordResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://lcimsforuserinfo.webservice.lcbms.linkage.com" use="encoded"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="LcimsForUserInfoService">
    <wsdl:port binding="impl:LcimsForUserInfoSoapBinding" name="LcimsForUserInfo">
    <wsdlsoap:address location="http://localhost:8080/services/LcimsForUserInfo"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>

    Two things you need to check
    1) configuration.properties Make sure you have correct app server settings and user name password. If you changed your password you need to update this file also.
    2) Stop WebServer clear web server cache and try reconnect.
    3) Web server logs should provide more details.

  • E4X: What happens to the root element?

    I'm working with XML using the E4X notation. I'm used to the "old school" XML APIs that use DOM and I'm a bit confused.
    For example, let's consider the following XML
    <mx:XML id="myXML" >
      <top>
        <sub1 id="uno">
          <sub2>hello</sub2>
          <sub3>world</sub3>
        </sub1>
        <sub1 id="duo">
          <sub2>ok</sub2>
          <sub3>ko</sub3>
        </sub1>
      </top>
    </mx:XML>
    In my code I use the following traces. This is done with the De MonsterDebugger, but all others should work the same way. I have casted the traces to String only to make it easier to ask this question (no need post images)
    MonsterDebugger.trace(this, "myXML:" + myXML);
    MonsterDebugger.trace(this, "myXML.sub1: " + myXML.sub1);
    MonsterDebugger.trace(this, "myXML.sub1.sub2: " + myXML.sub1.sub2);
    What I get as output is
    (String) = myXML:<top>
      <sub1 id="uno">
        <sub2>hello</sub2>
        <sub3>world</sub3>
      </sub1>
      <sub1 id="duo">
        <sub2>ok</sub2>
        <sub3>ko</sub3>
      </sub1>
    </top>
    (String) = myXML.sub1: <sub1 id="uno">
      <sub2>hello</sub2>
      <sub3>world</sub3>
    </sub1>
    <sub1 id="duo">
      <sub2>ok</sub2>
      <sub3>ko</sub3>
    </sub1>
    (String) = myXML.sub1.sub2: <sub2>hello</sub2>
    <sub2>ok</sub2>
    All is fine above and this was a bit long abstract for my question. The question is what happens to the root element, in this case <top>? I was trying to access the data with the following notation
    myXML.top.sub1; // etc
    I spent quite a lot of time trying to get it to work, until I discovered that the root element is not used. Can anyone explain this?
    Or, I guess the simple explanation is that the root node is ignored and the sub nodes are created as properties of the object. The question also could be stated as: Why isn't this documented in the Flex API Reference?
    Thanks.
    P.S. I found this article on common E4X pitfalls which also has other interesting topics when working with E4X.

    its gone
    downgrading would kill the phone..

  • How can i change the ROOT ELEMENT name in my ADOBE Form

    Hello All,
    I need to change "data" the Root Element default name to another name.
    Is this possible? How do i do this?
    Thank you all in advance,
    Eran

    Hello Chintan and Otto,
    thank you for your replies...
    Chintan: There is Adobe livecycle designer CE and its a stand alone application :[ designer CE2|http://www.adobe.com/products/livecycle/]
    Otto: I know i can send the xml back and change it in my abap program but i'm talking about stand alone form in a computer with no sap on it.
    The user will fill it and submit it ...
    Thank you all in advance,
    Eran

  • Getting oracle.xml.parser.v2.XMLParseException: Start Of root Element

    Hi All,
    I am getting below error while creating STUB/Skeleton in Jdeveloper to call a web service from OAF Page But getting below error while trying to creating Stub/Skeleton to call weservice
    ERROR:
    oracle.xml.parser.v2.XMLParseException: Start Of root Element
    Any suggestion on This
    P.S: I am calling a third party web service so can not able to make changes in XML
    Regards,
    903096

    Possibility is that there is a problem in the XML that is being passed. Can you double check with the third party software? Also check if you can try it outside OA Framework first and then if its tested you can integrate with EBS.

  • Oracle.xml.parser.v2.XMLParseException: Start of root element expected

    Hi,
    while trying to get a soapelement from xml file, i have the error : oracle.xml.parser.v2.XMLParseException: Start of root element expected
    the code i m using is as follow :
    public static SOAPMessage XMLDocToSOAP(String soapBodyAsString ) throws SAXException, IOException,
    SOAPException,
    ParserConfigurationException {
    SOAPMessage message = null;
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    InputStream is = new ByteArrayInputStream(soapBodyAsString.getBytes());
    Document doc = dbf.newDocumentBuilder().parse(is);
    MessageFactory factory = MessageFactory.newInstance();
    message = factory.createMessage();
    message.saveChanges();
    SOAPBodyElement element = message.getSOAPBody().addDocument(doc);
    return message;
    }

    Looks like the XML you are passing is not valid. Check that the XML complies the the definition.
    Also can you post a XML that works and the one that fails.
    cheers
    James

  • Org.xml.sax.SAXParseException: Document root element "taglib", must match D

    hi
    using tomcat 4
    and jdf1.5
    i am getting bellow error
    org.xml.sax.SAXParseException: Document root element "taglib", must match DOCTYPE root "null".

    Check your web.xml once again.

  • Org.xml.sax.SAXParseException: Document root element is missing.

    Hi,
    I am trying to get the portal login id from a weblogic server based application from iplaet portal server.
    I get this follwoing error
    org.xml.sax.SAXParseException: Document root element is missing.
    at com.sun.xml.parser.Parser.fatal(Parser.java:2817)
    at com.sun.xml.parser.Parser.fatal(Parser.java:2805)
    at com.sun.xml.parser.Parser.parseInternal(Parser.java:493)
    at com.sun.xml.parser.Parser.parse(Parser.java:284)
    at com.sun.xml.tree.XmlDocument.createXmlDocument(XmlDocument.java:226)
    at com.iplanet.portalserver.util.XMLParser.<init>(XMLParser.java:70)
    at com.iplanet.portalserver.naming.share.NamingResponseParser.<init>(NamingResponseParser.java:33)
    at com.iplanet.portalserver.naming.share.NamingResponse.parseXML(NamingResponse.java:74)
    at com.iplanet.portalserver.naming.WebtopNaming.updateNamingTable(WebtopNaming.java:174)
    at com.iplanet.portalserver.naming.WebtopNaming.getNamingProfile(WebtopNaming.java:155)
    at com.iplanet.portalserver.naming.WebtopNaming.getServiceURL(WebtopNaming.java:57)
    at com.iplanet.portalserver.session.Session.getSessionServiceURL(Session.java:534)
    at com.iplanet.portalserver.session.Session.getSessionServiceURL(Session.java:520)
    at com.iplanet.portalserver.session.Session.getSession(Session.java:414)
    at jsp_servlet.__eatonPortalLogin._jspService(__eatonPortalLogin.java:155)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1075)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:418)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:462)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
    <May 19, 2004 9:01:12 AM EDT> <Error> <HTTP> <101017> <[ServletContext(id=4873279,name=ematrix,context-path=/ematrix)] Root cause of ServletException
    com.iplanet.portalserver.session.SessionException
    at com.iplanet.portalserver.session.Session.getSessionServiceURL(Session.java:539)
    at com.iplanet.portalserver.session.Session.getSessionServiceURL(Session.java:520)
    at com.iplanet.portalserver.session.Session.getSession(Session.java:414)
    at jsp_servlet.__eatonPortalLogin._jspService(__eatonPortalLogin.java:155)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1075)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:418)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:462)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
    Any help/pointers will be appreciated.
    Ashish

    Just for anyone else who hits this problem: I encountered the same issue with an XML document that XMLSpy claims is quite well formed. I opened the document in a hex editor, and there at the from was a three-byte byte order marker - the marker that I believe the UTF-8 standard says is optional. I removed these three bytes, and the file was parsed correctly.
    In this case, the XML file was created using a Microsft DOM (save).
    My solution is to make the java parser - as I use it - a tad more robust: Open the file and create an input stream - a pushback input stream. Read the first three bytes; if they are NOT a BOM, then push those bytes back. Now - in any case - give the stream to the parser to read.
    try {
    // Open file for reading.
    f = new File(path);
    FileInputStream fis = new FileInputStream(f);
    PushbackInputStream pis = new PushbackInputStream(fis);
    byte[] buf = new byte[3];
    pis.read(buf, 0, 3);
    if (! (buf[0] == 0x00EF) && (buf[1] == 0x00BB) && (buf[2] == 0x00BF) ) {
         pis.unread(buf, 0, 3);
    builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    doc = builder.parse(pis);
    catch (Exception x) {
         x.printStackTrace();
    }

  • Xmlns in root element

    When converting exchange rates xml from http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
    I'm getting problem with xmlns in root element.
    CALL TRANSFORMATION triggers CX_XSLT_ABAP_CALL_ERROR, but only if there is xmlns attribute in first line in input xml:
    <gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref">
    Without this xmlns=.....  (or when modifying e.g. abcxmlns= ) works following xslt fine:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:strip-space elements="*"/>
      <xsl:template match="/">
        <xsl:copy>
          <xsl:apply-templates/>
        </xsl:copy>
      </xsl:template>
      <xsl:template match="Cube/Cube">
        <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
          <asx:values>
            <ROOT2>
              <xsl:value-of select="@time"/>
            </ROOT2>
            <ROOT1>
              <xsl:apply-templates select="Cube"/>
            </ROOT1>
          </asx:values>
        </asx:abap>
      </xsl:template>
      <xsl:template match="Cube/Cube/Cube">
        <loop>
          <AMOUNT>
            <xsl:value-of select="1"/>
          </AMOUNT>
          <CCYCODE>
            <xsl:value-of select="@currency"/>
          </CCYCODE>
          <VALUE>
            <xsl:value-of select="@rate"/>
          </VALUE>
        </loop>
      </xsl:template>
    </xsl:transform>
    I'd appreciate if someone migh advise me how to alternate the xslt or tell me what the xmlns in input does.
    Cheers
    Edited by: Viktor Kunc on Sep 29, 2008 3:25 PM

    If a namespace is specified on root level, it propagates down to all children, see:
    http://www.w3.org/TR/REC-xml-names/scoping
    The namespace is part of a name. So, if you have an element <Cube> as child of the root element <root xmlns="http://www.gesmes.org/xml/2002-08-01">, then
    <xsl:apply-templates select="Cube"/>
    won't be applied, since the qualified name of the element is not Cube but {http://www.gesmes.org/xml/2002-08-01}Cube
    If you want the XSLT to work with and without namespace equally well, you have to work with local names in XPath expressions:
    <xsl:apply-templates select="local-name() = 'Cube'"/>
    The same holds for all XPath functions working with element names.
    Usually, however, the namespace is part of the contract with the client and is
    either obligatory to be used
    or obligatory to be omitted.
    But not both.
    Regards,
    Rüdiger

  • No root element found in xml

    I am facing a problem when i am trying to use TOAD. Its giving me an error like
    NO ROOT ELEMENT FOUND IN XML. Can someone help me in corrcting this Error ?
    Regards,
    Chandra deep

    NO ROOT ELEMENT FOUND IN XML. Can someone help me in
    corrcting this Error ? That means the XML document is either missing the surrounding <element> ... </element> pair or has more than one pair at the base level of the document. Resolve that and you are done.
    Now ... given that I am probably 4,000+ km away from you and can not see your screen, please look at your question and ask yourself whether you have given sufficient information for troubleshooting. <g>

  • Getting Error in java mapping: Parsing empty source. Root element expected!

    Hi Experts,
       I am using java mapping for schema validation of input message. I have followed all the standard procedures and implemented the java class in the interface mapping.
    My interface mapping is like this:
    OrderData --->Java Class ---SchemaValidate
                         Mesg Map ---OrderData_to_BAP --->BAPI Msg
    So first I want to validate the schema of the input message. If the input message is invalid then XI should throw an exception. Then I use the actual message mapping to map the input order data to the BAPI input parameters.
    In the java code I am using xerces parser.
    The java code works fine when I run it as a standalone application.
    The interface mapping also works fine if I don't include the java mapping. Ofcourse schema validation does not happen.
    But when I test the interface mapping by including the java mapping then I am getting the error:
    Call method execute of the application Java mapping SchemaValidate
    Java mapping SchemaValidate completed. (execute() of SchemaValidate
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: Parsing an empty source. Root element expected!
    What am I doing wrong? Why it is not getting the root element?
    My Java code is as follows:
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import java.io.*;
    import java.util.Map;
    import javax.xml.parsers.*;
    import org.xml.sax.helpers.*;
    import org.xml.sax.*;
    import org.apache.xerces.jaxp.*;
    Sample mapper for SAP-XI
    @author Gopal
    public class SchemaValidate implements StreamTransformation {
        //Constants when using XML Schema for SAX parsing.
         static final String JAXP_SCHEMA_LANGUAGE =
         "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
         static final String W3C_XML_SCHEMA =
         "http://www.w3.org/2001/XMLSchema";
         static final String JAXP_SCHEMA_SOURCE =
         "http://java.sun.com/xml/jaxp/properties/schemaSource";
    Injection of mapping parameters
    from integration engine
    @param map Map with configuration data
        public void setParameter(Map map) {
    Mapping implementation
    @param inputStream Input data from integration engine
    @param outputStream Output data to integration engine
        public void execute(InputStream inputStream,
                            OutputStream outputStream)
          throws StreamTransformationException {
            try {
                  // obtain an object of class javax.xml.parsers.SAXParser,
                  SAXParserFactory spf = SAXParserFactoryImpl.newInstance();
                  spf.setNamespaceAware(true);
                  spf.setValidating(true);
                  SAXParser sp = spf.newSAXParser();
                  // setup the schema file
                  sp.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
                  sp.setProperty(JAXP_SCHEMA_SOURCE, new File("IOReqMsgSchema.xsd"));
                  //parse the input xml using the given schema
                  sp.parse(inputStream, new ParseErrorHandler());
            catch(SAXException se) {
              se.printStackTrace();
            catch ( Exception e ) {
              throw new StreamTransformationException( e.getMessage() );
    My input message is :
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:OrderCreate_request xmlns:ns0="mynamespace">
       <ORDER>HTEST1234567</ORDER>
       <ORDER_TYPE>z001</ORDER_TYPE>
       <ORDER_NAME>Test Order</ORDER_NAME>
       <CO_AREA>INTC</CO_AREA>
       <CCTR_POSTED>1234567890888888888</CCTR_POSTED>
       <CURRENCY>USD</CURRENCY>
       <PERSON_RESP>12345679</PERSON_RESP>
    </ns0:OrderCreate_request>
    Kindly help! please this is urgent!!!!!!
    Thanks
    Gopal
    Edited by: gopalkrishna baliga on Feb 28, 2008 9:34 AM

    Hi Stefan,
       I did the code changes to return output stream and the java code works perfectly in standalone mode in my PC.
       But when I use the same in the Java mapping with XI then It throws an error "Getting Error in java mapping: Parsing empty source. Root element expected!".
    My XI J2EE server has JDK1.4.3.11.
    Is there any limitation of using SAX parser in XI? If Yes, then which parser should be used for schema validation in XI?
    I have included the XSD file for schema validation along with class files in the .jar file. This jar file is then imported in XI repository. Is the XI engine not able to read the XSD file?
    Do I have to handle reading XSD file differently? Any suggession how?
    Is this parser error due to some security access?
    Kindly help me! I have been struggling with this problem since 2 weeks. I will be greatfull to you if you can help me.
    Thanks
    Gopal

  • "root element is missing" - UTF-8

    I have 2 identical files, except they are stored in ISO-8859-1 and UTF-8.
    "Test ansii.xml":
    <?xml version="1.0" encoding="ISO-8859-1"?><e></e>
    "Test utf8.xml":
    <?xml version="1.0" encoding="UTF-8"?><e></e>
    When I look at them in Internet Explorer they show correctly. But when I parse them with SAX in java I get an error when I parse the file stored in UTF-8.
    import java.io.*;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
      public static void testXML(){
        try{
          File ansiiFile=new File("Test ansii.xml");
          File utf8File=new File("Test utf8.xml");
          SAXParserFactory factory = SAXParserFactory.newInstance();
          SAXParser saxParser = factory.newSAXParser();
          //try ISO-8859-1
          InputSource in = new InputSource(new InputStreamReader(new FileInputStream(ansiiFile),"ISO-8859-1"));
          saxParser.parse(in,new DefaultHandler());
          //try UTF-8
          in = new InputSource(new InputStreamReader(new FileInputStream(utf8File),"UTF-8"));
          saxParser.parse(in,new DefaultHandler());
        }catch(Exception e){
          e.printStackTrace();
      }The first file parses well, but when I parse the file encoded in UTF-8 I get this error:
    org.xml.sax.SAXParseException: The Document root element is missing.
         at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182)
         at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3170)
         at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:501)
         at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
         at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
         at test.Test.testXML(Test.java:44)
         at test.Test.main(Test.java:25)
    Gil

    Sigh, I found the answer.
    http://www.i18ngurus.com/encyclopedia/byte_order_mark.html
    byte order mark
    Also known as BOM.
    Name given to the Unicode character U+FEFF when used at the beginning of a Unicode byte stream. This invisible character generally know as ZERO WIDTH NO-BREAK SPACE (ZWNBSP) serves to identify unambiguously the Unicode transformation form used (and especially the byte order) for the stream. Indeed U+FFFE is a noncharacter so there is no risk of misinterpretation.
    The following represents the byte signature of the character U+FEFF with the various Unicode Transformation Forms:
    Bytes Encoding
    00 00 FE FF UTF-32, big-endian
    FF FE 00 00 UTF-32, little-endian
    FE FF UTF-16, big-endian
    FF FE UTF-16, little-endian
    EF BB BF UTF-8
    Historically the ZWNBSP was also used to indicate non-breaking but this use is now deprecated and replaced by the character U+2060 for that purpose.
    http://p2p.wrox.com/archive/xslt/2002-11/79.asp
    I suspect you edited the stylesheet using a text editor that inserts the
    BOM at the start of the file. For example, I think Windows Notepad does
    this.
    Some XML parsers accept a BOM at the start of a UTF-8 file, others
    don't. For example, the Crimson parser that comes with JDK 1.4 doesn't.
    You basically need to find a text editor and an XML parser that agree
    with each other about whether or not to use a byte order mark.
    Alternatively, use a different encoding for the stylesheet, e.g.
    iso-8859-1.
    The code above found these strange bytes while expecting '<', and crashed of course.
    Gil

Maybe you are looking for

  • Apple Video Component Cable only for audio

    I want to buy an Apple Video Component Cable to use it with an iPhone 3GS and also with an iPod 5G. The cable will be connected to the TV and to the audio receiver. I know that this cable is not compatible with the iPod 5G, but in this case I only wa

  • Copy of Raw Images

    I burned a series of RAW images to DVD on my Mac and then read them into Photoshop on my PC. Although all the images are RAW on the Mac, the copied as jpeg's to the DVD.??? How do I get the RAW images copied as RAW images? Chuck

  • Firefox lately always opens a new window

    Whenever I click a link in firefox, whether I option-click it or right-click it and choose "Open in new Tab." Firefox lately always opens a new window, not a tab. For the life of me, I cannot get it to open a page in a new tab. There was a time when

  • How to Configure Fixed Maturity Plans (FMP) in Treasury Module

    Dear Gurus I am trying to find out how to configure Mutual Fund-FMPs ie the Fixed Maturity Plans in SAP Treasury Module. Can you please help me out with the same. Thanks and regards Shaurya

  • OpenESB: read message from Normalized Message Router

    Good morning, I have to build a simple Business Monitor System. I use NetBeans 6.5, Glassfish v2 with OpenESB. My Question is: there is a way to read messages exchanged between two different application (for example my CASA application and Salesforce