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.

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

  • 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.

  • XML "Document root element is missing"

    i have made a research in the forums but i have no definite solution about the error.
    my flash client sends XML stream to my ServerSocket. and i want to parse these XML datas.
    Document XMLDoc;
    DocumentBuilderFactory Factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder Builder = Factory.newDocumentBuilder() ;
    InputSource Is = new InputSource(new BufferedReader(new InputStreamReader(Sock.getInputStream(),"UTF-16LE")));
    XMLDoc = Builder.parse(Is);
    But now i have problem called "Document root element is missing". My XML stream comming from flash client :
    // Actionscript code :
         XDoc = new XML("<?XML version=\"1\"?><LOGIN><USERNAME>KHARON</USERNAME><PASSWORD>485009</PASSWORD></LOGIN>");
    ----- The XML data i want to sent to ...
    <?XML version="1"?>
    <LOGIN>
    <USERNAME>KHARON</USERNAME>
    <PASSWORD>485009</PASSWORD>
    </LOGIN>
    What is the problem ?

    now ?
    // Actionscript
    XSock = new XMLSocket();
    XSock.connect("127.0.0.1",6667);
    XDoc = new XML("<?xml version=\"1.0\"?><LOGIN><USERNAME>KHARON</USERNAME><PASSWORD>ew2345dfs</PASSWORD></LOGIN>");
    // Java
    public void run() {
    try {
    Document XMLDoc;
    DocumentBuilderFactory Factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder Builder = Factory.newDocumentBuilder() ;
    InputSource Is = new InputSource(new BufferedReader(new InputStreamReader(Sock.getInputStream(),"UTF-16LE")));
    XMLDoc = Builder.parse(Is);
    org.w3c.dom.Node Node = XMLDoc.getFirstChild();
    System.out.print(Node.getNodeValue());
    /* Incomming data test code
    System.out.print("Listening to incomming messeges");
    char in ;
    while ( (in = (char)Reader.read()) != -1 ) {
    System.out.print( in );
    but the result
    parser exception ( Document root element is missing )
    ihave made a research ( i am newbee in XML) and i have made some declerations like <!DOCTYPE LOGIN <!Element ...
    i have declared root element with DOC type decleration. but the same error. :|
    since 2 days i am working over these, but solution = null

  • Exception:"Decrease the number of char between the beginning of the document and its root element"

    I'm now using a javabean in my jsp page to parse xml;when my xml file's size is
    about 10k,it just work fine;when my xml file's size became 50k,it throws the followng
    Exception:
    Failed to open xml document,Failed to retrieve Public id or system id from the
    document. Decrease the number of char between the beginning of the document and
    its root element. But when I run this javabean in JBuild ,it works fine no matter
    how big the xml file becomes;
    Why? the error message is in the attachment.

    The prologue must be included at the top of the document, followed by the root
              element.
              joden2000 wrote:
              > what does this exception mean:decrease the number of char between the beginning
              > of the document and its root element? When my xml file is about 10k,it works
              > just fine,when it becomes 50k ,the exception show.How can I deal with this?
              

  • 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();
    }

  • 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

  • Root Element of a Text Node

    Hi All,
    I have the following XML Document.
    <?xml version="1.0"?>
    <addressbook>
    <address>
    <fname>Bill</fname>
    <lname>Gates</lname>
    <address>
    <address>
    <fname>Jones</fname>
    <lname>Bill</lname>
    <address>
    <address>
    <fname>Mark</fname>
    <lname>Anderson</lname>
    <address>
    <address>
    <fname>Bill</fname>
    <lname>Sam</lname>
    <address>
    <address>
    <fname>Charles</fname>
    <lname>Corbel</lname>
    <address>
    </addressbook>
    I need all the root element in the xml Document which has the data "Bill". How i can find that?
    Thanks in Advance,
    Mohideen.

    Hi Amaury,
    Thanks for your response.
    Already, I have been working on the logic that you had suggested. But it complicates the code much.
    I found JDOM API has the Text class with constructor of the type
    Text(java.lang.String str).I used that in my class.
    Here is the code,
    import org.jdom.*;
    import org.jdom.JDOMException;
    import org.jdom.input.SAXBuilder;
    public class SearchText
    public static void main(String[] args)
    try
    // use SAXBuilder to create DOM from numerous types of input
    SAXBuilder builder = new SAXBuilder();
    // expand entities within the SAXBuilder
    //builder.setExpandEntities(true);
    // SAXBuilder is more does create the entire DOM at once
    org.jdom.Document doc = builder.build(args[0]);
    System.out.println( doc );
    Text text = new Text("bill");
    //how to find out this text object in the Document class object
    Element parent = text.getParent();
    System.out.println("Parent:"+parent.toString());
    catch (JDOMException e)
    e.printStackTrace();
    I am getting the following run time error,
    Exception in thread "main" java.lang.NullPointerException
    at SearchText.main(SearchText.java:24)
    Please kindly notify me where i did the mistake.
    Thanks,
    Mohideen.

  • "Root element is missing." - While using Sharepoint List Source in SSIS.

    Hi Team,
    We are trying to import data from sharepoint list using sharepointlist source in SSIS. But the following error pops-up.
    [SP_SRC_SharePointList [67]] Error: System.Xml.XmlException: Root element is missing.
       at System.Xml.XmlTextReaderImpl.Throw(Exception e)
       at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
       at System.Xml.XmlTextReaderImpl.Read()
       at System.Xml.XmlReader.MoveToContent()
       at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
       at System.Xml.Linq.XElement.Parse(String text, LoadOptions options)
       at System.Xml.Linq.XElement.Parse(String text)
       at Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.SharePointListSource.PrimeOutput(Int32 outputs, Int32[] outputIDs, PipelineBuffer[] buffers)
       at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPrimeOutput(IDTSManagedComponentWrapper100 wrapper, Int32 outputs, Int32[] outputIDs, IDTSBuffer100[] buffers, IntPtr ppBufferWirePacket)
    We are unable to debug / move any further. Request your help.
    Thank you.
    Best Regards,
    Gayathri

    It appears that the XML you trying to load does indeed not have the root element.
    E.g.
    <?xml version="1.0" encoding="UTF-8"?>
    <iii>
    <kkk>test</kkk>
    <ppp>000</ppp>
    </iii>
    <iii>
    <kkk>test</kkk>
    <ppp>000</ppp>
    </iii>
    <iii>
    <kkk>test</kkk>
    <ppp>000</ppp>
    </iii>has nonemust be<?xml version="1.0" encoding="UTF-8"?>
    <Root><iii>
    <kkk>test</kkk>
    <ppp>000</ppp>
    </iii>
    <iii>
    <kkk>test</kkk>
    <ppp>000</ppp>
    </iii>
    <iii>
    <kkk>test</kkk>
    <ppp>000</ppp>
    </iii></Root>
    Arthur My Blog

  • Intresting problem with JDOM and xmlns in root element.

    Hi all,
    I am trying to parse a xml file using a jdom java code.This code works fine if I remove xmlns attribute in the root element.Please tell me how to fix this issue.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Xml
    <process name="CreateKBEntryService" targetNamespace="http://serena.com/CreateKBEntryService" suppressJoinFailure="yes" xmlns:tns="http://serena.com/CreateKBEntryService" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:nsxml0="http://localhost:8080/axis/services/CreateKBEntryService" xmlns:nsxml1="http://DefaultNamespace" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    <partnerLinks>
              <partnerLink name="client" partnerLinkType="tns:CreateKBEntryService" myRole="CreateKBEntryServiceProvider"/>
              <partnerLink name="CreateKBEntryPartnerLink" partnerLinkType="nsxml0:CreateKBEntryLink" partnerRole="CreateKBEntryProvider"/>
         </partnerLinks>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
    Java:
    import java.io.*;
    import java.util.*;
    import org.jdom.Document;
    import org.jdom.Element;
    import org.jdom.input.SAXBuilder;
    public class sample1 {
    public static void main(String[] args) throws Exception {
    // create a XML parser and read the XML file
    SAXBuilder oBuilder = new SAXBuilder();
    Document oDoc = oBuilder.build(new File("file location "));
         Element root = oDoc.getRootElement();
         System.out.println(root.getName());
         String tgtns= root.getAttributeValue("targetNamespace");
         System.out.println("tgt ns "+ tgtns);
    List list= root.getChildren("partnerLinks");
         Iterator it1= list.iterator();
         System.out.println(list.size());
         while(it1.hasNext()){
              Element partnerlinks = (Element)it1.next();
              List list2= partnerlinks.getChildren("partnerLink");
              System.out.println(list2.size());
              Iterator it2= list2.iterator();
              String[][] partnerLinkval = new String [2][list2.size()];
              int i=0,j=0;
              while(it2.hasNext())
                   Element el2= (Element)it2.next();
              String ElementName = el2.getName();
              partnerLinkval[i][j]= ElementName;
              j++;
              String Attribute = el2.getAttributeValue("myRole");
              partnerLinkval[i][j]= Attribute;
              i++;
              j--;
              System.out.println("Saving in array "+el2.getName());
              System.out.println("Saving in array "+Attribute);
              System.out.println("array length"+partnerLinkval.length);
              for (int l=0;l<2;l++){
              for(int k=0;k<partnerLinkval.length;k++)
                   System.out.println(partnerLinkval[l][k]);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Result:
    Without Xmlns in xml file
    process
    tgt ns http://serena.com/buildserviceflow
    1
    2
    Saving in array partnerLink
    Saving in array BpelServiceFlowProvider
    Saving in array partnerLink
    Saving in array null
    array length2
    partnerLink
    BpelServiceFlowProvider
    partnerLink
    null
    Result with xmlns:
    process
    tgt ns http://serena.com/CreateKBEntryService
    0

    Hi,
    I am also having the same problem using jdom, my code works fine when there is no xmlns attribute but when i put the xmlns attribute back in doesn't work.
    Did you manage to find a way to solve this problem?

  • WSDL incorrect - in XSD elements always must be the root element?

    Hi!
    First of all, sorry about my english, but I'm not accustomed to write in this language ;-)
    We're trying to publish a Webservice with JAXWS and with a classes generated via JAXB parsing a group of XSD files, always in a maven project with java 5.
    More explained the steps we are trying to follow:
    1) parse the XSD files with JAXB and generate a JAR file to be included like a dependency in the webapp
    2) use the classes packaged in the JAR in other maven project and define and deploy a webapp with the webservice using JAXWS defining a SEI that uses and returns a Type included in the JAR generated in the previous step. Here it is the interface that implements the SEI:
    @WebMethod
         public TESTELEMENT test(
                   @WebParam(name = "test")
                   TESTELEMENT element);The problem seems to be that if the elements in the original XSD files aren't root elements the WSDL generated is incorrect.
    Here there are the XSD files we are using and the WSDL error result (XMLSpy dixit, "ns1:Example" must refer to an existing element).
    Anyone knows what happens?
    Thank you in advance and sorry about this large message!
    +--- start of TEST.XSD --+
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns="http://example.work/test" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.work/test" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="TEST_TYPE.xsd"/>
    <!--
    if we define the Example Element like this, everything works ok! why? because Example is defined global?
    <xs:element name="Example" type="ExampleType"/>
    -->
    <xs:element name="TEST_ELEMENT">
    <xs:annotation>
    <xs:documentation>Blablabla</xs:documentation>
    </xs:annotation>
    <xs:complexType>
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Example" type="TestType"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>+-- end --+
    +--- start of TEST_TYPE.xsd --+
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns="http://example.work/test" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.work/test" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:complexType name="TestType">
    <xs:annotation>
    <xs:documentation>Example type</xs:documentation>
    </xs:annotation>
    <xs:sequence>
    <xs:element name="Element_A" type="xs:string"/>
    <xs:element name="Elment_B" type="xs:boolean"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>+-- end --+
    +-- start WSDL error --+
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions name="TestBO" targetNamespace="http://our.package.test/" xmlns:ns1="http://our.package.test/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wsdl:types>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://example.work/test" xmlns:tns="http://example.work/test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="TEST_ELEMENT">
    <xs:complexType>
    <xs:sequence>
    <xs:element maxOccurs="unbounded" minOccurs="0" name="Example" type="tns:TestType"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:complexType name="TestType">
    <xs:sequence>
    <xs:element name="Element_A" type="xs:string"/>
    <xs:element name="Elment_B" type="xs:boolean"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://our.package.test" xmlns:ns1="http://example.work/test" xmlns:tns="http://our.package.test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:import namespace="http://example.work/test"/>
    <xs:element name="test" type="tns:test"/>
    <xs:element name="testResponse" type="tns:testResponse"/>
    <xs:complexType name="test">
    <xs:sequence>
    <xs:element minOccurs="0" name="test">
    <xs:complexType>
    <xs:sequence>
    <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns1:Example"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="testResponse">
    <xs:sequence>
    <xs:element minOccurs="0" name="return">
    <xs:complexType>
    <xs:sequence>
    <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns1:Example"/> *<!-- here is the error - XMLSpy dixit that ns1:Example must refer to an existing element -->*
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    </wsdl:types>
    <wsdl:message name="test">
    <wsdl:part element="ns1:test" name="parameters">
    </wsdl:part>
    </wsdl:message>
    <wsdl:message name="testResponse">
    <wsdl:part element="ns1:testResponse" name="parameters">
    </wsdl:part>
    </wsdl:message>
    <wsdl:portType name="TestBO">
    <wsdl:operation name="test">
    <wsdl:input message="ns1:test" name="test">
    </wsdl:input>
    <wsdl:output message="ns1:testResponse" name="testResponse">
    </wsdl:output>
    </wsdl:operation>
    </wsdl:portType>
    </wsdl:definitions>+-- end --+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi again.
    About my last post, say that the WSDL generated, in fact, was generated with CXF, sorry.
    Using JAXWS (wsgen to be more explicit) the WSDL results still are not ok, as you can see, the error is in the last ns1:Example reference in ServeiTestBO_schema1.xsd, that XMLSpy says that doesn't exists :-( :
    +--- ServeiTestBOImplService.wsdl [ServeiTestBOImpl - SEI] ---+
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.5-b03-. -->
    <definitions targetNamespace="http://impl.our.package.test/" name="ServeiTestBOImplService" xmlns:tns="http://impl.our.package.test/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
      <import namespace="http://our.package.test/" location="ServeiTestBO.wsdl"/>
      <binding name="ServeiTestBOImplPortBinding" type="ns1:ServeiTestBO" xmlns:ns1="http://our.package.test/">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <operation name="test">
          <soap:operation soapAction=""/>
          <input>
            <soap:body use="literal"/>
          </input>
          <output>
            <soap:body use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="ServeiTestBOImplService">
        <port name="ServeiTestBOImplPort" binding="tns:ServeiTestBOImplPortBinding">
          <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
        </port>
      </service>
    </definitions>+--- ServeiTestBO.wsdl [SEI interface] ---+
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.5-b03-. -->
    <definitions targetNamespace="http://our.package.test/" xmlns:tns="http://our.package.test/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
      <types>
        <xsd:schema>
          <xsd:import namespace="http://our.package.test/" schemaLocation="ServeiTestBO_schema1.xsd"/>
        </xsd:schema>
        <xsd:schema>
          <xsd:import namespace="http://example.work/test" schemaLocation="ServeiTestBO_schema2.xsd"/>
        </xsd:schema>
      </types>
      <message name="test">
        <part name="parameters" element="tns:test"/>
      </message>
      <message name="testResponse">
        <part name="parameters" element="tns:testResponse"/>
      </message>
      <portType name="ServeiTestBO">
        <operation name="test">
          <input message="tns:test"/>
          <output message="tns:testResponse"/>
        </operation>
      </portType>
    </definitions>+--- ServeiTestBO_schema1.xsd *[with error in the last "ns1:Example"]* ---+
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xs:schema version="1.0" targetNamespace="http://our.package.test/" xmlns:tns="http://our.package.test/" xmlns:ns1="http://example.work/test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import namespace="http://example.work/test" schemaLocation="ServeiTestBO_schema2.xsd"/>
      <xs:element name="test" type="tns:test"/>
      <xs:element name="testResponse" type="tns:testResponse"/>
      <xs:complexType name="test">
        <xs:sequence>
          <xs:element name="test" minOccurs="0">
            <xs:complexType>
              <xs:sequence>
                <xs:element ref="ns1:Example" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="testResponse">
        <xs:sequence>
          <xs:element name="return" minOccurs="0">
            <xs:complexType>
              <xs:sequence>
                <xs:element ref="ns1:Example" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
    --- ServeiTestBO_schema2.xsd  ---
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xs:schema elementFormDefault="qualified" version="1.0" targetNamespace="http://example.work/test" xmlns:tns="http://example.work/test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="TEST_ELEMENT">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Example" type="tns:TestType" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:complexType name="TestType">
        <xs:sequence>
          <xs:element name="Element_A" type="xs:string"/>
          <xs:element name="Elment_B" type="xs:boolean"/>
          <xs:element name="Sex" type="tns:SexType"/>
        </xs:sequence>
      </xs:complexType>
      <xs:simpleType name="SexType">
        <xs:restriction base="xs:string">
          <xs:enumeration value="M"/>
          <xs:enumeration value="W"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:schema>Thanks in advance again.

  • Load xml - xls with OWB error "ORA-20011:....Start of root element expected

    Hi
    I need to load XML document into a table in Oracle warehouse builder.
    I've followed the steps as given in the user guide and I get the following error,
    ORA-20011: Error occurred while loading source XML document into the target database object PURCHASE_ORDERS.
    Base exception: Start of root element expected.
    ORA-06512: at "DC_DWH.WB_XML_LOAD_F", line 12
    ORA-06512: at "DC_DWH.WB_XML_LOAD", line 4
    ORA-06512: at line 7
    The steps are:
    DECLARE
    CONTROL_INFO VARCHAR2(200);
    BEGIN
    CONTROL_INFO := '<OWBXMLRuntime> <XMLSource> <file>c:\xml_test\y.xml</file> </XMLSource> <targets> <target XSLFile="c:\xml_test\y.xsl" dateFormat="yyyy.MM.dd">PURCHASE_ORDERS</target> </targets></OWBXMLRuntime>';
    DC_DWH.Wb_Xml_Load ( CONTROL_INFO );
    COMMIT;
    END;
    where:
    ------------- y.xml ----------------
    <purchaseOrder>
    <id>103123-4</id>
    <orderDate>2000-10-20</orderDate>
    <shipTo country="US">
    <name>Alice Smith</name>
    <street>123 Maple Street</street>
    <city>Mill Valley</city>
    <state>CA</state>
    <zip>90952</zip>
    </shipTo>
    <comment>Hurry, my lawn is going wild!</comment>
    <items>
    <item>
    <partNum>872-AA</partNum>
    <productName>Lawnmower</productName>
    <quantity>1</quantity>
    <USPrice>148.95</USPrice>
    <comment>Confirm this is electric</comment>
    </item>
    <item>
    <partNum>845-ED</partNum>
    <productName>Baby Monitor</productName>
    <quantity>1</quantity>
    <USPrice>39.98</USPrice>
    <shipDate>1999-05-21</shipDate>
    </item>
    </items>
    </purchaseOrder>
    -----------------y.xsl -------------------
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2004/07/xpath-functions" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes">
    <SHIPTO_NAME>
    <xsl:value-of select="purchaseOrder/shipTo/name"/>
    </SHIPTO_NAME>
    <SHIPTO_STREET>
    <xsl:value-of select="purchaseOrder/shipTo/street"/>
    </SHIPTO_STREET>
    <SHIPTO_CITY>
    <xsl:value-of select="purchaseOrder/shipTo/city"/>
    </SHIPTO_CITY>
    </xsl:stylesheet>
    Any help is appreciated

    Hello,
    The error occurs as far as your XSL file has incorrect structure. Your have to transform incoming XML in so-called (by Oracle) canonical form i.e.:
    <ROWSET>
    <ROW>
    <FIELD_1>value-for-field-1</FIELD_1>
    <FIELD_N>value-for-field-N</FIELD_N>
    </ROW>
    </ROWSET>
    So, assuming your table has three fields : SHIPTO_NAME, SHIPT_STREET, SHIPTO_CITY, - your XSL file should look like following:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:template match=”/”>
    <ROWSET>
    <xsl:apply-templates select=”purchaseOrder”/>
    </ROWSET>
    </xsl:template>
    <xsl:template match=”purchaseOrder”>
    <ROW>
    <SHIPTO_NAME><xsl:value-of select=”shipTo/name”/></SHIPTO_NAME>
    <SHIPTO_STREET><xsl:value-of select=”shipTo/street”/></SHIPTO_STREET>
    <SHIPTO_CITY><xsl:value-of select=”shipTo/city”/></SHIPTO_CITY>
    </ROW>
    </xsl:template>
    </xsl:stylesheet>
    Hope this will help.

  • Encountering XML-20108: (Fatal Error) Start of root element expected

    Hi,
    We are trying to invoke a XML Publisher report from a custom OAF page using API's. However, it is erroring out with the following error message (in xdo.log)
    [021710_121811671][oracle.apps.xdo.common.xml.XSLTWrapper][EXCEPTION] XSL error:
    <Line 1, Column 1>: XML-20108: (Fatal Error) Start of root element expected.
    [021710_121811672][oracle.apps.xdo.template.FOProcessor][STATEMENT] clearInputs(Object) is called.
    [021710_121811672][oracle.apps.xdo.template.FOProcessor][STATEMENT] clearInputs(Object) done. All inputs are cleared.
    [021710_121811673][][EXCEPTION] 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:597)
    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:1665)
    at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:975)
    at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5936)
    at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3459)
    at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3548)
    at lxe.oracle.apps.ibu.returnmgmt.server.RmaCreateReturnAMImpl.xxPrintShipLabel(RmaCreateReturnAMImpl.java:1046)
    at lxe.oracle.apps.ibu.returnmgmt.webui.OrderConfirmCo.processFormRequest(OrderConfirmCo.java:167)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:815)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:815)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
    at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processFormRequest(OAStackLayoutBean.java:370)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
    at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
    at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
    at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2863)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1840)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:538)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:426)
    at jtfcrmchrome.jspService(_jtfcrmchrome.java:1191)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:379)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
    at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
    at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
    at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
    at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
    at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: oracle.xdo.parser.v2.XMLParseException: Start of root element expected.
    at oracle.xdo.parser.v2.XMLError.flushErrors1(XMLError.java:337)
    at oracle.xdo.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:343)
    at oracle.xdo.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:285)
    at oracle.xdo.parser.v2.XMLParser.parse(XMLParser.java:289)
    ... 56 more
    The XML is generated from the code and is as below:
    <ShippingLabelVO>
    <ShippingLabelVORow>
    <RowKey>1</RowKey>
    <ShipSentToAddr>XXX Repair Center 125 Technology Parkway Austin, TX</ShipSentToAddr>
    <SerialNum>BC104</SerialNum>
    <OrderNum>8000324</OrderNum>
    <ItemNum>MX7AM-170540</ItemNum>
    </ShippingLabelVORow>
    </ShippingLabelVO>
    I can successfully create the PDF from the desktop using the above XML. When I add the XML file to sample XML (in data definition), I can see the output when I choose Preview.
    But, this is not working from the code.
    Any pointers?
    Thanks,
    Ashish

    Hi,
    We are currently on R12.XDO.B.1 (5.6.3?) Is there a patch we'll need to apply on top of this?
    Is there a workaround for this?
    Thanks,
    Ashish

  • XML-20108: (Fatal Error) Start of root element expected while restarting

    Hi All,
    I am work on OIM with the following configurations
    1)OS for App Server -- Linux
    2)App Server type and version -- Oracle Application Server 10g, version is 10.1.3.1.0
    3)OIM connector pack version -- 9.0.3
    I have restarted the servers and I got the following error message
    08/10/16 08:03:19 Stop process
    08/10/16 08:03:20 Shutting down...
    08/10/16 08:03:36 Start process
    08/10/16 08:08:09 WARNING: ApplicationStateRunning.loadConnectors Exception loading connector xlJMSResourceAdapterModule : Error parsing oc4j-ra.xml at /u01/app/oracle/product/10.1.3.1/OracleAS_1/j2ee/oim/application-deployments/default/xlJMSResourceAdapterModule: Fatal error at line 1 offset 1 in file:/u01/app/oracle/product/10.1.3.1/OracleAS_1/j2ee/oim/connectors/xlJMSResourceAdapterModule/xlJMS ResourceAdapterModule/: .<Line 1, Column 1>: XML-20108: (Fatal Error) Start of root element expected.
    08/10/16 08:08:09 WARNING: ApplicationStateRunning.loadConnectors Exception loading connector OracleASjms : Error parsing oc4j-ra.xml at /u01/app/oracle/product /10.1.3.1/OracleAS_1/j2ee/oim/application-deployments/default/OracleASjms: Fatal error at line 1 offset 1 in file:/u01/app/oracle/product/10.1.3.1/OracleAS_1/j2ee/oim/connectors/OracleASjms/OracleASjms/: .<Line 1, Column 1>: XML-20108: (Fatal Error) Start of root element expected.
    Oct 16, 2008 8:08:11 AM org.jgroups.protocols.UDP createSockets
    INFO: sockets will use interface 10.201.50.124
    Oct 16, 2008 8:08:11 AM org.jgroups.protocols.UDP createSockets
    INFO: socket information:
    local_addr=10.201.50.124:46865, mcast_addr=231.184.179.146:45577, bind_addr=/10.201.50.124, ttl=1
    sock: bound to 10.201.50.124:46865, receive buffer size=64000, send buffer size= 32000
    mcast_recv_sock: bound to 10.201.50.124:45577, send buffer size=150000, receive buffer size=80000
    mcast_send_sock: bound to 10.201.50.124:46866, send buffer size=150000, receive buffer size=80000
    Can any one help me out
    Thanks in Advance

    Have you modified the DB adapter wsdl manually ? provide more error details from payload and logs.

Maybe you are looking for

  • Pixelated images when exporting to a PDF

    I am having difficulty every time I export to a PDF. Many of the pictures in side the .indd file are extremely pixelated. They have all been linked properly and are high resolution to begin with. Not sure what is going on. Any suggestions and/or help

  • What is Over Under Absorption means?

    Hi guyz, When I'm running Cost Center Actual/Plan/Variance Reporting, there is a field that is called Over/Under Absorption. What does it mean by Over/Under Absorption? Thanks guyz

  • How to restore languages in spellchecker service?

    Dear all, A while ago I used the application Monolingual to delete all languages in my system but two, English and Portuguese. Recently I realized that this action caused the speller and grammar service to only spell-check in English or Portuguese. W

  • Lens profile selection?

    I'm using win 7-64. I have a lens Sony (Zeiss) 55mm/1.8 ZA. Camera Sony Alpha 7R (Full Frame) I start with uploading the profile Sony FE and select the lens. This normally works well and Lightroom comes automatically with the right lens/profile. Some

  • I'm giving up on matching colors for print...please help

    I have an image of a model whose sweatshirt is sky blue. I know I'm setting up my print dialogue options correctly for print. I have the paper profile selected, correct printer, etc. I also used On-Screen, soft proofing with my paper selected when ma