Parsing xml file error: Document root element is missing.

Hi,
When I try to parse an xml file with SAX parser, the SAXParseException message I got is: "Document root element is missing." Anybody knows what it is? How should I fix it? Thanks a lot in advance!
J.H.

An XML document has only a single root element. So after the XML header, your document must look something like this:
<tag>
</tag>
If you have more than one element like this, for example:
<tag>
</tag>
<anothertag>
</anothertag>
then you don't have a root element and your parser will give the message you referred to.

Similar Messages

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

  • CORE3282: stdout: org.xml.sax.SAXParseException: Document root element

    I got an application running on Sun ONE Web Server 6.1SP5, during the application start, I got the following message. The application can run without any problem. I would like to know if there is any solution to avoid the PARSE error? Thanks a lot.
    [01/Aug/2006:11:42:09] info (21921):      CORE1116: Sun ONE Web Server 6.1SP5 B08/18/2005 02:17
    [01/Aug/2006:11:42:09] info (21923):      CORE5076: Using [Java HotSpot(TM) Server VM, Version 1.4.2_04] from [Sun Microsystems Inc.]
    [01/Aug/2006:11:42:09] info (21923):      WEB0100: Loading web module in virtual server [https-sunfire] at [myapp]
    [01/Aug/2006:11:42:09] info (21923):      WEB0100: Loading web module in virtual server [https-sunfire] at [search]
    [01/Aug/2006:11:42:13] info (21923):      CORE3282: stdout: PARSE error at line 6 column 19
    [01/Aug/2006:11:42:13] info (21923):      CORE3282: stdout: org.xml.sax.SAXParseException: Document root element "taglib", must match DOCTYPE root "null".
    [01/Aug/2006:11:42:13] info (21923):      WEB2798: [myapp] ServletContext.log(): Loading Spring root WebApplicationContext
    [01/Aug/2006:11:42:18] info (21923):      WEB2798: [myapp] ServletContext.log(): Loading WebApplicationContext for Spring FrameworkServlet 'action'
    [01/Aug/2006:11:42:18] info (21923):      HTTP3072: [LS ls1] http://sunfire:9999 ready to accept requests
    [01/Aug/2006:11:42:18] info (21923):      CORE3274: successful server startup

    That doesn't say much. Which is this xml file? and what have you given in the <!DOCTYPE > tag? Probably, that is the mistake...

  • 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

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

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

    Check your web.xml once again.

  • Document root element is missing: migrating spring app from tomcat

    Hi!
    can anybody help me with this issue?
    I have ported my tomcat spring application to netweaver(6.40, SP 17, Windows 2k SP4) and i get the following error:
    Error occured in invoking event "contextInitialized()" on listener clas
    s com.webapp.listener.StartupListener. The error is: org.springfram
    ework.beans.factory.BeanCreationException: Error creating bean with nam
    e 'sessionFactory' defined in ServletContext resource [/WEB-INF/applica
    tionContext-hibernate.xml]: Initialization of bean failed; nested excep
    tion is org.hibernate.MappingException: Could not parse mapping documen
    t in input stream
    org.hibernate.MappingException: Could not parse mapp
    ing document in input stream
         at org.hibernate.cfg.Configuration.addIn
    putStream(Configuration.java:430)
         at org.springframework.orm.hibernat
    e3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.j
    ava:654)
         at org.springframework.beans.factory.support.AbstractAutowir
    eCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactor
    y.java:1059)
         at org.springframework.beans.factory.support.AbstractAut
    owireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.j
    ava:363)
         at org.springframework.beans.factory.support.AbstractBeanFac
    tory.getBean(AbstractBeanFactory.java:226)
         at org.springframework.bea
    ns.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java
    :147)
         at org.springframework.beans.factory.support.DefaultListableBea
    nFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
         at org.springframework.context.support.AbstractApplicationContext.ref
    resh(AbstractApplicationContext.java:320)
         at org.springframework.web.
    context.support.AbstractRefreshableWebApplicationContext.refresh(Abstra
    ctRefreshableWebApplicationContext.java:134)
         at org.springframework.w
    eb.context.ContextLoader.createWebApplicationContext(ContextLoader.java
    :246)
         at org.springframework.web.context.ContextLoader.initWebApplica
    tionContext(ContextLoader.java:184)
         at org.springframework.web.contex
    t.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:4
    9)
         at com.ifx.webapp.listener.StartupListener.contextInitialized(Star
    tupListener.java:42)
         at com.sap.engine.services.servlets_jsp.server.r
    untime.context.WebEvents.contextInitialized(WebEvents.java:45)
         at com
    .sap.engine.services.servlets_jsp.server.container.ApplicationThreadIni
    tializer.run(ApplicationThreadInitializer.java:112)
         at com.sap.engine
    .core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.sec
    urity.AccessController.doPrivileged(Native Method)
         at com.sap.engine.
    core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.
    sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    C
    aused by: org.dom4j.DocumentException: Error on line 1 of document  : D
    ocument root element is missing. Nested exception: Document root elemen
    t is missing.
         at org.dom4j.io.SAXReader.read(SAXReader.java:482)
         at
    org.hibernate.cfg.Configuration.addInputStream(Configuration.java:421)
         ... 18 more
    And yes, the xml files are valid xml files at least in anything i've used to look at them (eclipse, ultraedit, notepad, ie) :).....
    Thank you!
    ps. the file:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
        "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
        <!-- Hibernate SessionFactory -->
        <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="dataSource" ref="dataSource"/>
            <property name="mappingResources">
                <list>
                    <value>package/ModelObj1.hbm.xml</value>
                    <value>package/ModelObj2.hbm.xml</value>
                </list>
            </property>
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
                </props>
            </property>
        </bean>
        <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
        <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
            <property name="sessionFactory" ref="sessionFactory"/>
        </bean>
        <!-- Generic DAO - can be used when doing standard CRUD -->
        <bean id="dao" class="com.dao.hibernate.BaseDAOHibernate">
            <property name="sessionFactory" ref="sessionFactory"/>
        </bean>
    </beans>

    hi istvan,
    we are also migrating from websphere to netweaver.
    But in spring framework we r facing problems.
    We hav spring-beans.jar file in lib dir of Web Application. But When we are creating BeanFactory from xml as,
    BeanFactory beanFactory = new ClassPathXmlApplicationContext ("client-config.xml");
    clent-config.xml file contains :
    [code<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
         <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >
              <property name="location">
                   <value>conf/service-client/client.properties</value>
              </property>
         </bean></beans>
    [/code]
    But code is giving exception: ClassNotFoundException -org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.
    Wat is the problem ?
    Kindly help.
    We are also using JAAS for authentication.We are refering above code from our LoginModules login() method.
    Regards,
    sagar.

  • Parsing XML file Error

    while Parsing XML a runtime exception is coming.....
    org.xml.sax.SAXNotRecognizedException
    pl. help me..

    The following page will tell you when org.xml.sax.SAXNotRecognizedException is thrown. In short, you attempted to access a feature or property using an invalid flag.
    http://java.sun.com/j2se/1.5.0/docs/api/org/xml/sax/class-use/SAXNotRecognizedException.html

  • Does anyone know this message: "Document root element is missing"

    I'm getting this message by loading an XML File from my server into an DocumentBuilder. The only strange thing, if I'm doing that from my local machine (linux) it works, but executing by Java WebStart I get the message above !?!
    Does anyone know why?

    That was the first idea i had, but InputStream.available() on the given File means something about 3500 signs.
    Somewhere I read, that a Classpath, or Path may be missing, but I'm not using any special imports!
    package com.msgis.XML;
    import java.io.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    //API
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.FactoryConfigurationError;
    import javax.xml.parsers.ParserConfigurationException;
    //Exceptions
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    //Reading XML File
    import java.io.File;
    import java.io.IOException;
    //DOM definition and Exceptions
    import org.w3c.dom.Document;
    import org.w3c.dom.DOMException;
    //URL
    import java.net.URL;
    import java.net.*;
    Ideas?
    That is the only idea left, because, in the IDE (Sun ONE Studio 5 Update 1, Standard Edition) it works, and from other projects I know that the IDE is linking its own classes.
    java pgm does not work. It delivers the same Exception.
    SAXParseException Document blablabla .......

  • Document root element

    When starting Sun One Application Server 7 I get the following error in the console:
    SEVERE ( 5028): ContextConfig[ROOT] Parse error in application web.xml
    org.xml.sax.SAXParseException: Document root element "web-app", must match DOCTYPE root "null".
    What does this error mean and how do I fix?
    My web.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
      version="2.4">
      <display-name>My appliation</display-name>
      <description>My appliation</description>
      <context-param>
        <param-name>log4j-file</param-name>
        <param-value>WEB-INF/log4j.properties</param-value>
      </context-param>
      <listener>
        <listener-class>
          com.gh.web.listener.Listener
        </listener-class>
      </listener>
      <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
          <param-name>debug</param-name>
          <param-value>0</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
      </servlet>
      <jsp-config>
        <taglib>
          <taglib-uri>/tags/common</taglib-uri>
          <taglib-location>/WEB-INF/tld/common.tld</taglib-location>
        </taglib>
      </jsp-config>
    </web-app>

    If running on Tomcat Server, then is start without errors.
    I made a following change in web.xml and error is disappeared:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN'
      'http://java.sun.com/j2ee/dtds/web-app_2_3.dtd'>
    <web-app>
    </web-app>The reason for the 'break' is because I attempting to deploy a web application following the 2.4 spec that Sun One Application Server 7 does not support or why?

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

  • B2B-50029:  B2B runtime error: oracle.xml.parser.v2.XMLParseException: Start of root element expected.

    Dear All,
    I am a beginner to Oracle B2B.
    I have created an agreement to Recieve 852, Product Activity data(POS) from one of the Trading partner. This is an inbound process.
    A  SOA composite application is created to Recieve the data and insert into perticular columns of the database table using database adapter.
    I have tested the Interface with some couple of file and it went perfect without any error. Now I have to test the interface with some other files.
    This time also I am not getting any error in Business Message, Wire message and Application message but the composite application is not picked.
    The log file shows : B2B-50029: B2B runtime error: oracle.xml.parser.v2.XMLParserException: Start of root element expected.
    Please let me know if anyone has faced this issue. it will be of great help.
    Thanks,
    Abhas Kushwaha

    Hello,
    Just a thought, When I had the similar problem, it appeared to be a BOM (Byte order mark - Wikipedia, the free encyclopedia) in the xml file, which is the very first character in the xml file, so the file was not identified to be a valid xml file. Removing the BOM from the xml file fixed my problem, however, I did not spend much time in fixing using B2B, the vendor  (sender of the file) fixed the file and started sending without BOM. So my work was easier.
    The character is not visible in all XML editors, however, it was visible in JDeveloper. I used a tool to identify and remove during testing until the vendor fixed the file, the tool is called file bom detector,http://www.bryntyounce.com/filebomdetector.htm
    Hope this helps,
    Thanks,
    Venkatesh

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

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

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

  • Parsing an empty source. Root element expected! error in fcc using MTB

    Hi experts,
    While converting a flat file to xml using MTB , i'm facing this error in mapping.
    " com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping  .....
    Parsing an empty source. Root element expected!   "
    Whereas the audit log in file channel - Communication channel monitoring shows that , the payload transformed but i'm unable to view the source message.
    Please let me know the resolution if anyone has faced the same issue..
    thanks,
    younus

    hi,
    you want to convert yor receivee structure or sender??
    see these links about FCC to see how they do it.
    File Receiver with Content Conversion
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
    Type of separatos
    http://help.sap.com/saphelp_nw04/helpdata/en/05/7fdf3d0eb8af5ee10000000a114084/frameset.htm
    Troubleshooting the File Adapter
    /people/shabarish.vijayakumar/blog/2007/07/26/troubleshooting-the-file-adapter-last-updated-on-02-july10
    Converting File Content in a Sender Adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    Converting File Content in the Receiver Adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm
    Thanks
    Rodrigo
    PD: Reward points if useful
    Edited by: Rodrigo Pertierra on May 14, 2008 12:11 PM

  • B1if Error: Parsing an empty source. Root element expected!

    Dear experts,
    i have created a scenario from SAP PI to SAP B1if.
    Under On package i have created multiple scenarios and all were working succesfully.
    But i added another scenario now and tested its giving the below error.
    infact now , when i am testing the scenarios (which were working succesfully before), all of them are giving the same error as below:
    SAP B1iP detected an error:
    Emitted HTTP-Code
    500 - Internal Server Error
    Internal Reason
    Parsing an empty source. Root element expected!
    Full Internal Error Message
    com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: com.sap.b1i.bizprocessor.BizProcException: BPE001 Nested exception: com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: com.sap.b1i.bizprocessor.BizProcException: BPE001 Nested exception: com.sap.b1i.utilities.UtilException: UTE001 Nested exception: javax.xml.transform.TransformerConfigurationException: Could not load stylesheet. java.io.IOException: Parsing an empty source. Root element expected!
    i am givng the correct input message with root nodes etc but still i am getting the error.
    Please help!!
    Thanks.

    hi,
    you want to convert yor receivee structure or sender??
    see these links about FCC to see how they do it.
    File Receiver with Content Conversion
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
    Type of separatos
    http://help.sap.com/saphelp_nw04/helpdata/en/05/7fdf3d0eb8af5ee10000000a114084/frameset.htm
    Troubleshooting the File Adapter
    /people/shabarish.vijayakumar/blog/2007/07/26/troubleshooting-the-file-adapter-last-updated-on-02-july10
    Converting File Content in a Sender Adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    Converting File Content in the Receiver Adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm
    Thanks
    Rodrigo
    PD: Reward points if useful
    Edited by: Rodrigo Pertierra on May 14, 2008 12:11 PM

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

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

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

Maybe you are looking for