Loading ...
Sorry, an error occurred while loading the content.
 

FitNesse fatal error encountered at command line

Expand Messages
  • Robert Stagner
    I ve encountered the following fatal error whenever I attempt to run fitnesse from the command line using the -xml option. c: fitnesse java -cp fitnesse.jar
    Message 1 of 6 , Jul 1, 2009
      I've encountered the following fatal error whenever I attempt to run fitnesse from the command line using the -xml option.


      c:\fitnesse>java -cp fitnesse.jar fitnesse.runner.TestRunner -xml c:\results.xml localhost 8080 PathToProject.SuitePublisherManagementTests.SuiteExistenceTests

      [Fatal Error] :1:56: The markup in the document following the root element must be well-formed.

      Exception in thread "main" org.xml.sax.SAXParseException: The markup in the docu
      ment following the root element must be well-formed.
              at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown So
      urce)
              at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unk
      nown Source)
              at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
              at util.XmlUtil.newDocument(XmlUtil.java:31)
              at util.XmlUtil.newDocument(XmlUtil.java:36)
              at fitnesse.runner.TestRunner.run(TestRunner.java:91)
              at fitnesse.runner.TestRunner.main(TestRunner.java:51)


      Has anybody else encountered this? And, if so, are there any workarounds available?  If not, any suggestions as to what might be causing this to occur? 

      Thanks.

    • Gregor Gramlich
      Does it work, if you append the &format=xml to the suite url in the browser?
      Message 2 of 6 , Jul 1, 2009
        Does it work, if you append the &format=xml to the suite url in the browser?

        http://localhost:8080/PathToProject.SuitePublisherManagementTests.SuiteExistenceTests?suite&format=xml

        Gregor


        2009/7/1 Robert Stagner <restagner@...>:
        >
        >
        > I've encountered the following fatal error whenever I attempt to run
        > fitnesse from the command line using the -xml option.
        >
        >
        > c:\fitnesse>java -cp fitnesse.jar fitnesse.runner.TestRunner -xml
        > c:\results.xml localhost 8080
        > PathToProject.SuitePublisherManagementTests.SuiteExistenceTests
        >
        > [Fatal Error] :1:56: The markup in the document following the root element
        > must be well-formed.
        >
        > Exception in thread "main" org.xml.sax.SAXParseException: The markup in the
        > docu
        > ment following the root element must be well-formed.
        > at
        > com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown So
        > urce)
        > at
        > com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unk
        > nown Source)
        > at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        > at util.XmlUtil.newDocument(XmlUtil.java:31)
        > at util.XmlUtil.newDocument(XmlUtil.java:36)
        > at fitnesse.runner.TestRunner.run(TestRunner.java:91)
        > at fitnesse.runner.TestRunner.main(TestRunner.java:51)
        >
        >
        > Has anybody else encountered this? And, if so, are there any workarounds
        > available? If not, any suggestions as to what might be causing this to
        > occur?
        >
        > Thanks.
        >
        >
      • Robert Stagner
        Gregor, Thanks for taking the time to review and reply to my question. As it turns out, I am using the Wiki Import feature. Further testing and
        Message 3 of 6 , Jul 6, 2009
          Gregor,

          Thanks for taking the time to review and reply to my question.  As it turns out, I am using the Wiki Import feature.  Further testing and experimentation indicated that the problem lies with the "Automatically update imported content when executing tests" property of the Suite or Test page.  When this property is enabled (i.e., the check box is checked), then I see the "[Fatal Error] :1:56: The markup in the document following the root element must ..." message.  However, if the "Automatically update imported content when executing tests" property is disabled, then the test runner produces the expected XML output file.  I've also been able to successfully transform the XML output to HTML using the XSL file that you provided in an earlier posting .   The resulting HTML file looks great!!

          Regards,
          Robert


          From: Gregor Gramlich <gramlich@...>
          To: Robert Stagner <restagner@...>
          Sent: Friday, July 3, 2009 12:24:57 AM
          Subject: Re: [fitnesse] FitNesse fatal error encountered at command line

          Hi Robert,

          I thought, it might be the problem that the velocity templates are
          missing in your files directory.

          http://www.nabble.com/XML-output-report-fails-for-github-head-revision-td23042937.html

          But it seems that you were able to generate some XML output. Just make
          sure and take a look at the console where you started the FitNesse
          server from (with run.bat or run.sh).


          > <span class="meta">Updating imported content...</span><span
          > class="meta">done</span><?xml version...

          Do you use WikiImport? Does it help to turn the Automatic Update Option off?

          If that helps, perhaps you can have your CI server (or whereever you
          want to generate the reports) use non-imported versions, resp. no
          automatic updates.

          Gregor


          2009/7/3 Robert Stagner <restagner@...>:
          > Gregor,
          >
          > Here is what I've found.  Using IE 7 produces the following error message:
          > --------------------------------------------------------------------------------
          > The XML page cannot be displayed
          > Cannot view XML input using XSL style sheet. Please correct the error and
          > then click the Refresh button, or try again later.
          >
          > Only one top level element is allowed in an XML document. Error processing
          > resource 'http://localhost:8080/PublisherNetwork...
          >
          > <span class="meta">Updating imported content...</span><span
          > class="meta">done</span><?xml version...
          >
          --------------------------------------------------------------------------------
          >
          > Whereas, using Firefox 3.0.11, it appears to return the appropriate XML
          > response (see attached file, "SuitePermissionTests.xml").  So, there is a
          > bit of inconsistency on how FitNesse(?) is behaving.  I'd like to use the
          > command line in order to output the test results to an XML file and then use
          > the XSL file you posted in an earlier thread to transform the XML to HTML.
          > ________________________________
          > From: Gregor Gramlich <gramlich@...>
          > To: fitnesse@yahoogroups.com
          > Sent: Wednesday, July 1, 2009 7:05:46 AM
          > Subject: Re: [fitnesse] FitNesse fatal error encountered at command line
          >
          >
          >
          >
          Does it work, if you append the &format=xml to the suite url in the browser?
          >
          > http://localhost:8080/PathToProject.SuitePublisherManagementTests.SuiteExistenceTests?suite&format=xml
          >
          > Gregor
          >
          > 2009/7/1 Robert Stagner <restagner@yahoo. com>:
          >>
          >>
          >> I've encountered the following fatal error whenever I attempt to run
          >> fitnesse from the command line using the -xml option.
          >>
          >>
          >> c:\fitnesse> java -cp fitnesse.jar fitnesse.runner. TestRunner -xml
          >> c:\results.xml localhost 8080
          >> PathToProject. SuitePublisherMa nagementTests. SuiteExistenceTe sts
          >>
          >> [Fatal Error] :1:56: The markup in the document following the root element
          >> must be
          well-formed.
          >>
          >> Exception in thread "main" org.xml.sax. SAXParseExceptio n: The markup in
          >> the
          >> docu
          >> ment following the root element must be well-formed.
          >> at
          >> com.sun.org. apache.xerces. internal. parsers.DOMParse r.parse(Unknown So
          >> urce)
          >> at
          >> com.sun.org. apache.xerces. internal. jaxp.DocumentBui lderImpl. parse(Unk
          >> nown Source)
          >> at javax.xml.parsers. DocumentBuilder. parse(Unknown Source)
          >> at util.XmlUtil. newDocument( XmlUtil.java: 31)
          >> at util.XmlUtil. newDocument( XmlUtil.java: 36)
          >> at fitnesse.runner. TestRunner. run(TestRunner. java:91)
          >> at fitnesse.runner. TestRunner. main(TestRunner. java:51)
          >>
          >>
          >> Has anybody else encountered this? And, if so, are there any workarounds
          >> available?
          If not, any suggestions as to what might be causing this to
          >> occur?
          >>
          >> Thanks.
          >>
          >>
          >
          >
          >

        • Gregor Gramlich
          Hi, I already sent this (unintentionally) to Robert privately, now for the list. I took a look at the source and someone fooled himself, when writing the
          Message 4 of 6 , Jul 8, 2009
            Hi,

            I already sent this (unintentionally) to Robert privately, now for the list.

            I took a look at the source and someone fooled himself, when writing
            the fitnesse.responders.run.XMLFormatter.writeHead() method. It
            actually does not write the head. Output of the XML header seems to
            happen later. So the WikiImport messages are printed before the XML
            header is written.

            fitnesse.responders.run.TestResponder{
            protected void doSending() throws Exception {
            fastTest |= request.hasInput("debug");
            remoteDebug |= request.hasInput("remote_debug");
            data = page.getData();

            // The following line should output the header, but for XML it does not!!!!
            createFormatterAndWriteHead();
            // and here the WikiImport message are sent.
            sendPreTestNotification();

            performExecution();
            int exitCode = formatter.allTestingComplete();
            closeHtmlResponse(exitCode);
            }
            }

            Even if the head was written, we still were in trouble, because the
            two <span> elements had to be put inside the xml root element
            <testResults>

            Gregor

            2009/7/6 Gregor Gramlich <gramlich@...>:
            > Hi Robert,
            >
            > I took a look at the source and someone fooled himself, when writing
            > the fitnesse.responders.run.XMLFormatter.writeHead() method. It
            > actually does not write the head. Output of the XML header seems to
            > happen later. So the WikiImport messages are printed before the XML
            > header is written.
            >
            > fitnesse.responders.run.TestResponder{
            > protected void doSending() throws Exception {
            > fastTest |= request.hasInput("debug");
            > remoteDebug |= request.hasInput("remote_debug");
            > data = page.getData();
            >
            > // The following line should output the header, but for XML it does not!!!!
            > createFormatterAndWriteHead();
            > // and here the WikiImport message are sent.
            > sendPreTestNotification();
            >
            > performExecution();
            > int exitCode = formatter.allTestingComplete();
            > closeHtmlResponse(exitCode);
            > }
            > }
            >
            > Even if the head was written, we still were in trouble, because the
            > two <span> elements had to be put inside the xml root element
            > <testResults>
            >
            > Gregor
            >
            >
            > 2009/7/6 Robert Stagner <restagner@...>:
            >> Gregor,
            >>
            >> Thanks for taking the time to review and reply to my question. As it turns
            >> out, I am using the Wiki Import feature. Further testing and
            >> experimentation indicated that the problem lies with the "Automatically
            >> update imported content when executing tests" property of the Suite or Test
            >> page. When this property is enabled (i.e., the check box is checked), then
            >> I see the "[Fatal Error] :1:56: The markup in the document following the
            >> root element must ..." message. However, if the "Automatically update
            >> imported content when executing tests" property is disabled, then the test
            >> runner produces the expected XML output file. I've also been able to
            >> successfully transform the XML output to HTML using the XSL file that you
            >> provided in an earlier posting . The resulting HTML file looks great!!
            >>
            >> Regards,
            >> Robert
            >>
            >
          • Robert C. Martin
            Thanks Robert and Gregor, This has been fixed in the July release.
            Message 5 of 6 , Jul 8, 2009
              Thanks Robert and Gregor,

              This has been fixed in the July release.


              --- In fitnesse@yahoogroups.com, Gregor Gramlich <gramlich@...> wrote:
              >
              > Hi,
              >
              > I already sent this (unintentionally) to Robert privately, now for the list.
              >
              > I took a look at the source and someone fooled himself, when writing
              > the fitnesse.responders.run.XMLFormatter.writeHead() method. It
              > actually does not write the head. Output of the XML header seems to
              > happen later. So the WikiImport messages are printed before the XML
              > header is written.
              >
              > fitnesse.responders.run.TestResponder{
              > protected void doSending() throws Exception {
              > fastTest |= request.hasInput("debug");
              > remoteDebug |= request.hasInput("remote_debug");
              > data = page.getData();
              >
              > // The following line should output the header, but for XML it does not!!!!
              > createFormatterAndWriteHead();
              > // and here the WikiImport message are sent.
              > sendPreTestNotification();
              >
              > performExecution();
              > int exitCode = formatter.allTestingComplete();
              > closeHtmlResponse(exitCode);
              > }
              > }
              >
              > Even if the head was written, we still were in trouble, because the
              > two <span> elements had to be put inside the xml root element
              > <testResults>
              >
              > Gregor
              >
              > 2009/7/6 Gregor Gramlich <gramlich@...>:
              > > Hi Robert,
              > >
              > > I took a look at the source and someone fooled himself, when writing
              > > the fitnesse.responders.run.XMLFormatter.writeHead() method. It
              > > actually does not write the head. Output of the XML header seems to
              > > happen later. So the WikiImport messages are printed before the XML
              > > header is written.
              > >
              > > fitnesse.responders.run.TestResponder{
              > > protected void doSending() throws Exception {
              > > fastTest |= request.hasInput("debug");
              > > remoteDebug |= request.hasInput("remote_debug");
              > > data = page.getData();
              > >
              > > // The following line should output the header, but for XML it does not!!!!
              > > createFormatterAndWriteHead();
              > > // and here the WikiImport message are sent.
              > > sendPreTestNotification();
              > >
              > > performExecution();
              > > int exitCode = formatter.allTestingComplete();
              > > closeHtmlResponse(exitCode);
              > > }
              > > }
              > >
              > > Even if the head was written, we still were in trouble, because the
              > > two <span> elements had to be put inside the xml root element
              > > <testResults>
              > >
              > > Gregor
              > >
              > >
              > > 2009/7/6 Robert Stagner <restagner@...>:
              > >> Gregor,
              > >>
              > >> Thanks for taking the time to review and reply to my question. As it turns
              > >> out, I am using the Wiki Import feature. Further testing and
              > >> experimentation indicated that the problem lies with the "Automatically
              > >> update imported content when executing tests" property of the Suite or Test
              > >> page. When this property is enabled (i.e., the check box is checked), then
              > >> I see the "[Fatal Error] :1:56: The markup in the document following the
              > >> root element must ..." message. However, if the "Automatically update
              > >> imported content when executing tests" property is disabled, then the test
              > >> runner produces the expected XML output file. I've also been able to
              > >> successfully transform the XML output to HTML using the XSL file that you
              > >> provided in an earlier posting . The resulting HTML file looks great!!
              > >>
              > >> Regards,
              > >> Robert
              > >>
              > >
              >
            • Robert Martin
              ... I believe this bug is fixed in the new release. ... Robert C. Martin (Uncle Bob) | email: unclebob@objectmentor.com Object Mentor Inc. | blog:
              Message 6 of 6 , Jul 20, 2009
                > Re: FitNesse fatal error encountered at command linePosted by:
                > "Robert Stagner" restagner@... restagnerFri Jul 17, 2009
                > 5:00 am (PDT)
                >
                >
                > Gregor,
                >
                > Thanks for taking the time to review and reply to my question. As it
                > turns out, I am using the Wiki Import feature. Further testing and
                > experimentation indicated that the problem lies with the
                > "Automatically update imported content when executing tests"
                > property of the Suite or Test page. When this property is enabled
                > (i.e., the check box is checked), then I see the "[Fatal Error] :
                > 1:56: The markup in the document following the root element
                > must ..." message. However, if the "Automatically update imported
                > content when executing tests" property is disabled, then the test
                > runner produces the expected XML output file. I've also been able to
                > successfully transform the XML output to HTML using the XSL file
                > that you provided in an earlier posting . The resulting HTML file
                > looks great!!

                I believe this bug is fixed in the new release.

                ----
                Robert C. Martin (Uncle Bob) | email: unclebob@...
                Object Mentor Inc. | blog: blog.objectmentor.com
                The Agile Transition Experts | web: www.objectmentor.com
                800-338-6716 | twitter: unclebobmartin
              Your message has been successfully submitted and would be delivered to recipients shortly.