Xerces Sockets and The root element is required

Hi,
I have a problem with Xerces 1.4.3 saying "The root element is required in a well-formed document.". The story is as follows:
When I read the XML from a file, it works OK.
But when I send the file over a socket stream, and try to parse it in the client side, it gives this silly message.
I am sure that there is no space before <?xml ... ?> and also the xml file is well formed.
I guess someone can say Xerces 2 solves this problem but I am using JBuilder 7 and I could not install the new xerces over old one. If someone knows how to do this please let me know. (Copying the jars into jbuilder7/lib does not seems to work as the file names are different and it wont overwrite the old xerces parser)
Any solution?
Thanks,

saving and parsing is working fine. hehe :)
seems that the parser is somewhat going crazy.
btw. I had written a class extending InputStream, so that it reads more than one file from a socket stream. But I have used it in this save and parse test and it worked so I dont think I have problems with that.
In one forum here, I saw someone saying that changing the version solved his problems about this silly thing. I think I wil try this.
Tankut

Similar Messages

  • The root element is required in a well-formed document.

    While trying to parse the following xml file using jaxp.jar and xerces.jar I am getting the following exception
    org.xml.sax.SAXParseException: The root element is required in a well-formed document.
    at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1196)
    at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:570)
    at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.endOfInput(XMLDocumentScanner.java:790)
    at org.apache.xerces.framework.XMLDocumentScanner.endOfInput(XMLDocumentScanner.java:418)
    at org.apache.xerces.validators.common.XMLValidator.sendEndOfInputNotifications(XMLValidator.java:694)
    at org.apache.xerces.readers.DefaultEntityHandler.changeReaders(DefaultEntityHandler.java:1026)
    at org.apache.xerces.readers.XMLEntityReader.changeReaders(XMLEntityReader.java:168)
    at org.apache.xerces.readers.AbstractCharReader.changeReaders(AbstractCharReader.java:150)
    at org.apache.xerces.readers.AbstractCharReader.lookingAtChar(AbstractCharReader.java:217)
    at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.dispatch(XMLDocumentScanner.java:686)
    at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
    at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
    at XMLConverter.parse(XMLConverter.java:65)
    at XMLConverter.parse(XMLConverter.java:116)
    at XMLConverter.main(XMLConverter.java:282)
    xml file
    <?xml version="1.0"?>
    <CustomerOrder>
    <Customer>
    <FirstName> Bob </FirstName>
    <LastName> Hustead </LastName>
    <CustId> abc.123 </CustId>
    </Customer>
    <OrderItems>
    <OrderItem>
    <Quantity> 1 </Quantity>
    <ProductCode> 48.GH605A </ProductCode>
    <Description> Pet Rock </Description>
    <Price> 19.99 </Price>
    </OrderItem>
    <OrderItem>
    <Quantity> 12 </Quantity>
    <ProductCode> 47.9906Z </ProductCode>
    <Description> Bazooka Bubble Gum </Description>
    <Price> 0.33 </Price>
    </OrderItem>
    <OrderItem>
    <Quantity> 2 </Quantity>
    <ProductCode> 47.7879H </ProductCode>
    <Description> Flourescent Orange Squirt Gun </Description>
    <Price> 2.50 </Price>
    </OrderItem>
    </OrderItems>
    </CustomerOrder>
    Can anybody please help me.
    Thanks in advance

    Hi There,
    I too am experiencing the same problem. I originally began with the problem described in
    http://forum.java.sun.com/thread.jsp?forum=34&thread=138862
    I removed the jaxp.jar and parser.jar from Tomcat's Lib folder and added the xerces.jar. This moved me on to the problem described in this thread.
    Here is my XML file:
    <?xml version="1.0"?>
    <training_seminar>
         <student>
              <id>0001</id>
              <name>Joe Jones</name>
              <email>[email protected]</email>
              <passport level="4 course">yes</passport>
         </student>
         <student>
              <id>0031</id>
              <name>Patrick Thompson</name>
              <email>[email protected]</email>
              <passport>no</passport>
         </student>
    </training_seminar>
    And here is my XSL:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              version="1.0">
    <xsl:template match="training_seminar">
    <HTML><BODY>
         <TABLE BORDER="1">
         <TR>
              <TH>Student ID</TH>
              <TH>Name</TH>
              <TH>E-Mail</TH>
              <TH>Passport</TH>
         </TR>
         <xsl:for-each select="student">
              <TR>
                   <TD> <xsl:value-of select="id"/></TD>
                   <TD> <xsl:value-of select="name"/> </TD>
                   <TD> <xsl:value-of select="email"/> </TD>
                   <TD> <xsl:value-of select="passport"/> </TD>
              </TR>
         </xsl:for-each>
         </TABLE>
    </BODY></HTML>
    </xsl:template>
    </xsl:stylesheet>
    And I guess while I am at it, my classpath:
    CLASSPATH=e:\java\jdk1.3.1\jre\lib\rt.jar;e:\jakarta-tomcat-3.2.3\lib\servlet.jar;E:\Dev Tools\xalan-j_2_1_0\bin\xerces.jar;E:\Dev Tools\xalan-j_2_1_0\bin\xalan
    .jar;E:\Dev Tools\xalan-j_2_1_0\bin\xsltc.jar;E:\Dev Tools\xalan-j_2_1_0\bin\xml
    .jar;.
    Any ideas is truly appreciated.
    Thanks,
    Gregg

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

  • TLD Error:The markup in the document preceding the root element must...

    Hello, I am new to using the Tag Libraries, i am getting the following error which seems to be in my treeTag.tld file, I am pasting the error message and the treeTag.tld at the bottom of this message. Any help is much appreciated.
    Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: XML parsing error on file /TreeTag/treeTag.tld: (line 5, col 1): The markup in the document preceding the root element must be well-formed.
         at org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:218)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:283)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:219)
         at ***************************************************
    Here is my treeTag.tld file
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    - <taglib>
         <tlibversion>1.1</tlibversion>
         <jspversion>1.1</jspversion>
         <shortname>Tree taglib</shortname>
         <uri>http://www.servletsuite.com/servlets/treetag</uri>
         <info>Tree tags</info>
         - <tag>
              <name>createTree</name>
              <tagclass>com.cj.tree.createTree</tagclass>
              <bodycontent>JSP</bodycontent>
              <info>Creates HTML-based tree view</info>
         </tag>
         - <tag>
              <name>addNode</name>
              <tagclass>com.cj.tree.addNode</tagclass>
              <bodycontent>JSP</bodycontent>
              <info>adds node</info>
              - <attribute>
                   <name>code</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
         </tag>
    </taglib>
    Regards,
    Navin Pathuru.

    You might make sure - if you havent already - that you are using the must up to date jsp version

  • The markup in the document preceding the root element must be well-formed

    Hi,
    Each time I add some library, something serious happens to my NetBeans5.5 and Tomcat 5.5.17. This time I added jsf-facelets.jar and now nothing is being deployed. I m getting following exception
    javax.servlet.ServletException: Error Parsing /Dept.jsp: Error Traced[line: 1] The markup in the document preceding the root element must be well-formed.
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:202)
    Is there any special procedure to follow to add libraries?
    Plz help.

    Facelets is XHTML. XHTML is XML-HTML. XML require strict well-formness of the tags. I.e. every tag should be correctly nested and closed.
    I would say, read the Facelets Developer Documentation: http://www.google.com/search?q=facelets+developer+documentation

  • E4X: What happens to the root element?

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

    its gone
    downgrading would kill the phone..

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

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

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

  • Real time transaction response - unable to locate the root element

    Hi There
    Has anyone integrated webMethods with Data Services 3.2 for real time transactions?
    We are trying to create a real time dataflow, initiated by webMethods.  We are sending the request to the Access Server which runs our
    real time dataflow and does process the request.  However, our return response is null.  No data in the response back to webMethods.  We have
    tested this in soapUI, and our transaction does work.  We get the correct response back. 
    So my question is has any experienced this issue with webMethods?  Any suggestions or ideas?
    Here is the error
    ===========================================
    Path name: 
         PortType: Real-time_Services
         Operation: Realtime_address_cleanse
    WSDL code:  S-9043
    [ISS.0092.9043] Schema Error: 1
         pathName: null
         errorCode: CONV-004
         errorMessage: [ISC.0082.9104] DataOut - unable to locate the root element
         identifier: null
    ===========================================
    ps- xmlspy does not work as well
    Please let me know
    Thanks
    Kurt

    The problem was the generated test SOAP message from Netbeans. When built, the interface had more levels than described below. I've also had similar issues caused by bad namespaces - either not defined properly or not picking up the default namespace.

  • Rename the root element  in a XMLTYPE field

    Hello, I have to rename the root element of an XMLTYPE like :
    Change :
    <Address>
    <Name>Dupont</Name>
    <Street>Av de la gare</Street>
    </Address>
    To :
    <CustomerAddress>
    <Name>Dupont</Name>
    <Street>Av de la gare</Street>
    </CustomerAddress>
    One solution will be to use the EXTRACT (a.xml, '/*/*') AS "CustomerAddress"
    I am just afraid about performance !!!
    Anyone has an advice
    Best Regards

    Pl go through this doc/Title
    XML Schema Evolution
    This chapter describes how you can update your XML schema after you have registered it with Oracle XML DB. XML schema evolution is the process of updating your registered XML schema and let me know if this helps.

  • Start of the root element expected.

    Hello Gurus,
    I moved all my project contents from one root directory to another, after seting up everything. It gives compile time error on adf-faces-config.xml and adf-faces-skins.xml.
    The error:
    XML-20108 - Start of the root element expected.
    I have no idea what could have originated this error and how to fix it. Can any one help me?
    Thank you.
    Ruchir

    I built the new project structure from scratch. i.e. created new application, then added a web project, then added all css file from old locations, then, created new xml documents and renamed it to adf-config-faces.xml and adf-faces-skins.xml and manually copied from these config xml documents from old location to newer one.
    And then at last, copied the .jspx page and when compiling that, control moves to adf-config-faces.xml file and gives the error.
    Thanks,
    Ruchir

  • The markup in the document following the root element must be well-formed.

    I have my XML root element that looks like this:
    <DataResponseOfListOfSite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www
    .w3.org/2001/XMLSchema" xmlns="http://xxxxxx/webservices/sites/">
    and I get the error "The markup in the document following the root element must be well-formed."
    If I use this it works fine:
    <DataResponseOfListOfSite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www
    .w3.org/2001/XMLSchema" xmlns:xsi="http://xxxxxx/webservices/sites/">
    Does anyone know why I have to have the xmlns:xsi="" instead of just xmlns=""
    If I paste this XML into any validator, it says that its good, so I dont know why Flex is complaining about it.

    In the first one you have two namespaces both with the same prefix.
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" and xmlns:xsi="http://xxxxxx/webservices/sites/"
    Thanks,
    Gaurav Jain
    Flex SDK Team
    http://www.gauravj.com/blog

  • The name and the root of the hard drive change, how can i reset it?

    the name and the root of the hard drive change, how can i reset it?

    That sort of thing doesn't happen automatically,. Someone had to change it. Just rename it anything you like. Right click on it and select Get Info then in the Name and Extension are name what you like.

  • Oracle Certification and the Hands-On Course Requirement (Part 1)

    Some good info for many of you who are working on an Oracle certification: "Oracle Certification and the Hands-On Course Requirement" http://bit.ly/P1yyh

    Neha,
    One item that may be helpful for you is the Hands On Course Form Tutorial http://www.oracle.com/global/us/education/certification/pdfs/hands.pdf.
    ->How many Questions they ask in Hands on Course ?
    Different forms have a different number of questions depending on the path and number of courses that are approved to count toward the certification
    ->"when did you take it" , should I answer in duration or the Start date of batch or end date of batch ?
    You should provide the course start date
    ->What is "Course Facility Name"?
    The name of the facility where you took your course
    ->will i be asked to provide the order number which i get from oracle while registering the exam at oracle ?
    You will need your course enrollment number. This should be in the documentation that you received when you registered for the course
    ->is it correct Course Title - Oracle 9i DBA Fundamental II ?
    You should find your course title on your course completion certificate. There will be a list of courses to choose from on the "test"/form.
    ->I dont receive any certificate from SQL STAR , But will be getting after 3-4 weeks, in the mean time i wish to fill HOC ?Can i Do it ?
    Yes you can do it, you'll just need to be sure that you have all the information that is required >Course title, Course enrollment number, training location.
    ->Please give more questions which can be asked in it , whether it is known or not ?
    You will also need your Prometric ID.
    Regards,
    Brandye Barrington
    Certification Forum Moderator
    Certification Program Manager

  • Oracle Certification and the Hands-On Course Requirement" (Part 2)

    Part 2 to Tuesday's post now online: "Oracle Certification and the Hands-On Course Requirement" (Part 2)" http://bit.ly/L9ID8

    Neha,
    One item that may be helpful for you is the Hands On Course Form Tutorial http://www.oracle.com/global/us/education/certification/pdfs/hands.pdf.
    ->How many Questions they ask in Hands on Course ?
    Different forms have a different number of questions depending on the path and number of courses that are approved to count toward the certification
    ->"when did you take it" , should I answer in duration or the Start date of batch or end date of batch ?
    You should provide the course start date
    ->What is "Course Facility Name"?
    The name of the facility where you took your course
    ->will i be asked to provide the order number which i get from oracle while registering the exam at oracle ?
    You will need your course enrollment number. This should be in the documentation that you received when you registered for the course
    ->is it correct Course Title - Oracle 9i DBA Fundamental II ?
    You should find your course title on your course completion certificate. There will be a list of courses to choose from on the "test"/form.
    ->I dont receive any certificate from SQL STAR , But will be getting after 3-4 weeks, in the mean time i wish to fill HOC ?Can i Do it ?
    Yes you can do it, you'll just need to be sure that you have all the information that is required >Course title, Course enrollment number, training location.
    ->Please give more questions which can be asked in it , whether it is known or not ?
    You will also need your Prometric ID.
    Regards,
    Brandye Barrington
    Certification Forum Moderator
    Certification Program Manager

  • Intermediate CA certificate and the Root CA certificate

    HI
    What are Intermediate CA certificate and the Root CA certificate ??
    What is the difference between these two types of certificates ??
    What are all the other alternative names that are used with these names ??
    thanks
    kumar

    Hi,
    An intermediate certificate is the certificate, or certificates, that go between your site (server) certificate and a root certificate.
    The intermediate certificate, or certificates, completes the chain to a root certificate trusted by the browser.
    Using an intermediate certificate means that you must complete an additional step in the installation process to enable your site certificate to be chained to the trusted root, and not show errors in the browser when someone visits your web site.
    Refer
    https://support.comodo.com/index.php?_m=downloads&_a=view&parentcategoryid=1&pcid=0&nav=0
    The advantages of using intermediate certificates u2013 Sometimes referred to as u2018chainingu2019
    http://www.whichssl.com/intermediate_certificates2.html
    Root certificate
    The root certificate is usually made trustworthy by some mechanism other than a certificate, such as by secure physical distribution. For example, some of the most well-known root certificates are distributed in the Internet browsers by their manufacturers.
    a root certificate is either an unsigned public key certificate or a self-signed certificate that identifies the Root Certificate Authority (CA). A root certificate is part of a public key infrastructure scheme. The most common commercial variety is based on the ITU-T X.509 standard, which normally includes a digital signature from a certificate authority (CA).
    http://support.microsoft.com/kb/887413
    Thanks
    swarup

Maybe you are looking for