[JIRA] [fitnesse] (JENKINS-20174) Corrupt FitNesse plugin XML report generated

113 views
Skip to first unread message

thierry.sorgnard@gmail.com (JIRA)

unread,
Jan 28, 2014, 4:00:38 AM1/28/14
to jenkinsc...@googlegroups.com

I have same problem with Fitnesse plugin version 1.8., Jenkins 1.523

same pb in my xml file.
It looks like jenkins is writing two time same downloaded xml content into file.

My tests take 4 hours to run (this is expected)

Here is standard output.

Started by timer
Building in workspace C:\Users\Administrator\.jenkins\workspace\FITNESSE_XXXX

Deleting project workspace... done

hudson.plugins.fitnesse.FitnesseBuilder: {fitnesseTargetPage=XXXX.SuiteIteration19&suiteFilter=ECRAN_XXXX, fitnesseTargetIsSuite=true, fitnesseHost=XXXX, fitnesseHttpTimeout=48000000, fitnessePortRemote=8080, fitnesseStart=False, fitnessePathToXmlResultsOut=fitnesse-results.xml}
Connnecting to http://XXXX:8080/XXXX.SuiteIteration19?suite&suiteFilter=ECRAN_XXXX&format=xml&includehtml
Connected: 200/OK
2k...
5k...
8k...
11k...

2334k...
2337k...
2342k...
2345k...
Xml results saved as windows-1252 to C:\Users\Administrator\.jenkins\workspace\FITNESSE_XXXX\fitnesse-results.xml
Reading results as windows-1252 from C:\Users\Administrator\.jenkins\workspace\FITNESSE_XXXX\fitnesse-results.xml
Parsing results...
javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at hudson.plugins.fitnesse.NativePageCountsParser.transformRawResults(NativePageCountsParser.java:25)
at hudson.plugins.fitnesse.NativePageCountsParser.parse(NativePageCountsParser.java:17)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.getResults(FitnesseResultsRecorder.java:131)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.getResults(FitnesseResultsRecorder.java:109)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.perform(FitnesseResultsRecorder.java:73)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Caused by: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(Unknown Source)
... 16 more
Caused by: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
... 17 more
---------
javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at hudson.plugins.fitnesse.NativePageCountsParser.transformRawResults(NativePageCountsParser.java:25)
at hudson.plugins.fitnesse.NativePageCountsParser.parse(NativePageCountsParser.java:17)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.getResults(FitnesseResultsRecorder.java:131)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.getResults(FitnesseResultsRecorder.java:109)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.perform(FitnesseResultsRecorder.java:73)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Caused by: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
... 17 more
---------
com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at hudson.plugins.fitnesse.NativePageCountsParser.transformRawResults(NativePageCountsParser.java:25)
at hudson.plugins.fitnesse.NativePageCountsParser.parse(NativePageCountsParser.java:17)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.getResults(FitnesseResultsRecorder.java:131)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.getResults(FitnesseResultsRecorder.java:109)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.perform(FitnesseResultsRecorder.java:73)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
---------
org.xml.sax.SAXParseException; lineNumber: 40188; columnNumber: 8; The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPIData(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanPIData(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPI(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(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.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at hudson.plugins.fitnesse.NativePageCountsParser.transformRawResults(NativePageCountsParser.java:25)
at hudson.plugins.fitnesse.NativePageCountsParser.parse(NativePageCountsParser.java:17)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.getResults(FitnesseResultsRecorder.java:131)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.getResults(FitnesseResultsRecorder.java:109)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.perform(FitnesseResultsRecorder.java:73)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
---------
com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at hudson.plugins.fitnesse.NativePageCountsParser.transformRawResults(NativePageCountsParser.java:25)
at hudson.plugins.fitnesse.NativePageCountsParser.parse(NativePageCountsParser.java:17)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.getResults(FitnesseResultsRecorder.java:131)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.getResults(FitnesseResultsRecorder.java:109)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.perform(FitnesseResultsRecorder.java:73)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
---------
org.xml.sax.SAXParseException; lineNumber: 40188; columnNumber: 8; The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPIData(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanPIData(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPI(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(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.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at hudson.plugins.fitnesse.NativePageCountsParser.transformRawResults(NativePageCountsParser.java:25)
at hudson.plugins.fitnesse.NativePageCountsParser.parse(NativePageCountsParser.java:17)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.getResults(FitnesseResultsRecorder.java:131)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.getResults(FitnesseResultsRecorder.java:109)
at hudson.plugins.fitnesse.FitnesseResultsRecorder.perform(FitnesseResultsRecorder.java:73)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Build step 'Publish Fitnesse results report' changed build result to FAILURE
Build step 'Publish Fitnesse results report' marked build as failure

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

antoine_dev@aumjaud.fr (JIRA)

unread,
May 19, 2014, 7:49:05 AM5/19/14
to jenkinsc...@googlegroups.com

To fix this issue, you can add this groovy script between the Fitnesse tests execution and the Fitnesse publish result report step. It create a new result file.

def head = 0
def lines = new File( 'fitnesse_tmp_result.xml' ).readLines()
lines = lines.findAll{ line ->
  if (line == '<?xml version="1.0"?>') head++
  return head == 1
}

new File( 'fitnesse_result.xml' ).withWriter { w ->
  lines.each{ line ->
    w.write(line + '\n')
  }
}

djlpro@outlook.com (JIRA)

unread,
May 23, 2014, 11:46:06 AM5/23/14
to jenkinsc...@googlegroups.com
David JL commented on Bug JENKINS-20174

Thanks for your answer Antoine!
However, I'm not exactly sure where I'm suppose to insert said groovy script. Could you provide some guidance?

antoine_dev@aumjaud.fr (JIRA)

unread,
May 27, 2014, 4:45:23 AM5/27/14
to jenkinsc...@googlegroups.com

Hello David,

You can use this Groovy script to fix this issue, for this you should:

  • Install Jenkins Groovy plugin in your Jenkins - https://wiki.jenkins-ci.org/display/JENKINS/Groovy+plugin
  • Configure Groovy Jenkins Administration (Choose Install automatically)
  • In your Jenkins job, add a "Execute Groovy script" step after the "Execute Fitnesse tests" step
  • Select "Groovy command" and copy past this groovy script (you must change fitnesse_tmp_result.xml by output fitnesse file used in "Fitnesse tests execution" and fitnesse_result.xml by the name you put in Publish Fitnesse report.
    That's all.

I have checked quickly in the source code for the reason of this issue, but I haven't find yet. I can reproduce this bug, so, as soon as possible, I will debug the code.
Regards,

antoine_dev@aumjaud.fr (JIRA)

unread,
May 27, 2014, 4:47:22 AM5/27/14
to jenkinsc...@googlegroups.com
 
Antoine Aumjaud edited a comment on Bug JENKINS-20174

Hello David,

You can use this Groovy script to fix this issue, for this you should:

  • Select "Groovy command" and copy past this groovy script (you must change fitnesse_tmp_result.xml by output fitnesse file used in "Execute Fitnesse tests" and fitnesse_result.xml by the name you put in "Publish Fitnesse result report".
    That's all.

I have checked quickly in the source code for the reason of this issue, but I haven't find yet. I can reproduce this bug, so, as soon as possible, I will debug the code.
Regards,

djlpro@outlook.com (JIRA)

unread,
May 27, 2014, 7:29:22 AM5/27/14
to jenkinsc...@googlegroups.com
David JL commented on Bug JENKINS-20174

Haha, I was unfamiliar with the Groovy plugin and thought you were just using 'groovy' as an adjective.

Thanks a lot for the answer, trying it out now.

Regards

djlpro@outlook.com (JIRA)

unread,
Jun 3, 2014, 8:58:25 AM6/3/14
to jenkinsc...@googlegroups.com

I managed to install groovy and get the scripts to execute correctly via Jenkins. However I now have the following issue:

Xml results saved as windows-1252 to C:\Users\Administrator\.jenkins\workspace\FITNESSE_ECRAN_EXPLOIT_3\fitnesse_tmp_result.xml
[FITNESSE_ECRAN_EXPLOIT_3] $ "C:\Program Files (x86)\Groovy\Groovy-2.3.2\bin\groovy.exe" C:\Users\Administrator\.jenkins\workspace\FITNESSE_ECRAN_EXPLOIT_3\hudson7296783988754375979.groovy
Reading results as windows-1252 from C:\Users\Administrator\.jenkins\workspace\FITNESSE_ECRAN_EXPLOIT_3\fitnesse_result.xml
Parsing results...
javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Invalid byte 2 of 3-byte UTF-8 sequence.

It would appear the file produced by the groovy script has some sort of encoding issue.

Still trying to figure this one out.

djlpro@outlook.com (JIRA)

unread,
Jun 3, 2014, 8:58:25 AM6/3/14
to jenkinsc...@googlegroups.com
 
David JL edited a comment on Bug JENKINS-20174

djlpro@outlook.com (JIRA)

unread,
Jun 3, 2014, 9:04:24 AM6/3/14
to jenkinsc...@googlegroups.com

I managed to install groovy and get the scripts to execute correctly via Jenkins. However I now have the following issue:

Xml results saved as windows-1252 to C:\Users\Administrator\.jenkins\workspace[JOB]\fitnesse_tmp_result.xml


[FITNESSE_ECRAN_EXPLOIT_3] $ "C:\Program Files (x86)\Groovy\Groovy-2.3.2\bin\groovy.exe" C:\Users\Administrator\.jenkins\workspace\FITNESSE_ECRAN_EXPLOIT_3\hudson7296783988754375979.groovy

Reading results as windows-1252 from C:\Users\Administrator\.jenkins\workspace[JOB]\fitnesse_result.xml


Parsing results...
javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Invalid byte 2 of 3-byte UTF-8 sequence.

It would appear the file produced by the groovy script has some sort of encoding issue.

Still trying to figure this one out.

djlpro@outlook.com (JIRA)

unread,
Jun 3, 2014, 9:06:23 AM6/3/14
to jenkinsc...@googlegroups.com

I managed to install groovy and get the scripts to execute correctly via Jenkins. However I now have the following issue:

Xml results saved as windows-1252 to C:\Users\Administrator\.jenkins\workspace[JOB]\fitnesse_tmp_result.xml

[[JOB]] $ "C:\Program Files (x86)\Groovy\Groovy-2.3.2\bin\groovy.exe" C:\Users\Administrator\.jenkins\workspace[JOB]\hudson7296783988754375979.groovy


Reading results as windows-1252 from C:\Users\Administrator\.jenkins\workspace[JOB]\fitnesse_result.xml
Parsing results...
javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Invalid byte 2 of 3-byte UTF-8 sequence.

It would appear the file produced by the groovy script has some sort of encoding issue.

Still trying to figure this one out.

djlpro@outlook.com (JIRA)

unread,
Jun 3, 2014, 9:06:22 AM6/3/14
to jenkinsc...@googlegroups.com

I managed to install groovy and get the scripts to execute correctly via Jenkins. However I now have the following issue:

Xml results saved as windows-1252 to C:\Users\Administrator\.jenkins\workspace[JOB]\fitnesse_tmp_result.xml

[[JOB]] $ "C:\Program Files (x86)\Groovy\Groovy-2.3.2\bin\groovy.exe" C:\Users\Administrator\.jenkins\workspace\FITNESSE_ECRAN_EXPLOIT_3\hudson7296783988754375979.groovy


Reading results as windows-1252 from C:\Users\Administrator\.jenkins\workspace[JOB]\fitnesse_result.xml
Parsing results...
javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Invalid byte 2 of 3-byte UTF-8 sequence.

It would appear the file produced by the groovy script has some sort of encoding issue.

Still trying to figure this one out.

antoine_dev@aumjaud.fr (JIRA)

unread,
Jun 30, 2014, 5:14:04 AM6/30/14
to jenkinsc...@googlegroups.com

I think it is an encoding issue of the new file

You can try this script:
def encoding = System.getProperty("file.encoding")
new File('fitnesse_tmp_result.xml').withReader(encoding) { reader ->
new File('fitnesse_result.xml').withWriter(encoding) { writer ->
def found = 0;
while ((line = reader.readLine()) != null) { if(line == "<?xml version=\"1.0\"?>" && ++found == 2) break writer.writeLine(line) }
}}

If it doesn't work, you can try to set directly the encoding variable to the real file endoding of fitnesse_tmp_result.xml, e.g. def encoding = "UTF-8"

Reply all
Reply to author
Forward
0 new messages