damianszczepanik / cucumber-reporting

HTML reports for Cucumber
GNU Lesser General Public License v2.1
548 stars 403 forks source link

Fatal error in parsing json file #88

Closed hangvar closed 9 years ago

hangvar commented 9 years ago

Hi,

I get the following error message in Jenkins when running a job to create the cucumber report (Jenkins ver. 1.543 and cucumber-reports 0.0.24):

[CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] copying all json files from slave: /var/lib/jenkins/workspace/ConfigurationService_extended/ConfigurationServiceTest/target/cucumber-reports to master reports directory: /var/lib/jenkins/jobs/ConfigurationService_extended/builds/2015-04-10_14-37-59/cucumber-html-reports [CucumberReportPublisher] Found the following number of json files: 1 [CucumberReportPublisher] 0. Found a json file: cucumber.json [CucumberReportPublisher] Generating HTML reports FATAL: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:34) at net.masterthought.cucumber.ReportParser.(ReportParser.java:24) at net.masterthought.cucumber.ReportBuilder.(ReportBuilder.java:77) at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:109) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706) at hudson.model.Run.execute(Run.java:1703) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231)

kingsleyh commented 9 years ago

Does it work on master ok? Instead of slave

Sent from my iPhone

On 10 Apr 2015, at 14:02, Jonas Hangvar notifications@github.com wrote:

Hi,

I get the following error message in Jenkins when running a job to create the cucumber report (Jenkins ver. 1.543 and cucumber-reports 0.0.24):

[CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] copying all json files from slave: /var/lib/jenkins/workspace/ConfigurationService_extended/ConfigurationServiceTest/target/cucumber-reports to master reports directory: /var/lib/jenkins/jobs/ConfigurationService_extended/builds/2015-04-10_14-37-59/cucumber-html-reports [CucumberReportPublisher] Found the following number of json files: 1 [CucumberReportPublisher] 0. Found a json file: cucumber.json [CucumberReportPublisher] Generating HTML reports FATAL: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:34) at net.masterthought.cucumber.ReportParser.(ReportParser.java:24) at net.masterthought.cucumber.ReportBuilder.(ReportBuilder.java:77) at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:109) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706) at hudson.model.Run.execute(Run.java:1703) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231)

— Reply to this email directly or view it on GitHub.

hangvar commented 9 years ago

No, I get this when run on the master:

[CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] copying all json files from: /var/lib/jenkins/workspace/ConfigurationService_extended/ConfigurationServiceTest/target/cucumber-reports to reports directory: /var/lib/jenkins/jobs/ConfigurationService_extended/builds/2015-04-13_09-11-16/cucumber-html-reports [CucumberReportPublisher] Found the following number of json files: 1 [CucumberReportPublisher] 0. Found a json file: cucumber.json [CucumberReportPublisher] Generating HTML reports FATAL: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)Jjava.lang.NoSuchMethodError http://stacktrace.jenkins-ci.org/search?query=java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:34) http://stacktrace.jenkins-ci.org/search/?query=net.masterthought.cucumber.ReportParser.parseJsonResults&entity=method at net.masterthought.cucumber.ReportParser.(ReportParser.java:24) http://stacktrace.jenkins-ci.org/search/?query=net.masterthought.cucumber.ReportParser.%3Cinit%3E&entity=method at net.masterthought.cucumber.ReportBuilder.(ReportBuilder.java:77) http://stacktrace.jenkins-ci.org/search/?query=net.masterthought.cucumber.ReportBuilder.%3Cinit%3E&entity=method at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:109) http://stacktrace.jenkins-ci.org/search/?query=net.masterthought.jenkins.CucumberReportPublisher.perform&entity=method at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) http://stacktrace.jenkins-ci.org/search/?query=hudson.tasks.BuildStepMonitor$1.perform&entity=method at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.perform&entity=method at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps&entity=method at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030) http://stacktrace.jenkins-ci.org/search/?query=hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2&entity=method at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.post&entity=method at hudson.model.Run.execute(Run.java:1703) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Run.execute&entity=method at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519) http://stacktrace.jenkins-ci.org/search/?query=hudson.maven.MavenModuleSetBuild.run&entity=method at hudson.model.ResourceController.execute(ResourceController.java:88) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.ResourceController.execute&entity=method at hudson.model.Executor.run(Executor.java:231) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Executor.run&entity=method

2015-04-10 15:20 GMT+02:00 Kingsley Hendrickse notifications@github.com:

Does it work on master ok? Instead of slave

Sent from my iPhone

On 10 Apr 2015, at 14:02, Jonas Hangvar notifications@github.com wrote:

Hi,

I get the following error message in Jenkins when running a job to create the cucumber report (Jenkins ver. 1.543 and cucumber-reports 0.0.24):

[CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] copying all json files from slave: /var/lib/jenkins/workspace/ConfigurationService_extended/ConfigurationServiceTest/target/cucumber-reports to master reports directory: /var/lib/jenkins/jobs/ConfigurationService_extended/builds/2015-04-10_14-37-59/cucumber-html-reports [CucumberReportPublisher] Found the following number of json files: 1 [CucumberReportPublisher] 0. Found a json file: cucumber.json [CucumberReportPublisher] Generating HTML reports FATAL: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:34) at net.masterthought.cucumber.ReportParser.(ReportParser.java:24) at net.masterthought.cucumber.ReportBuilder.(ReportBuilder.java:77) at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:109) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706) at hudson.model.Run.execute(Run.java:1703) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231)

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/masterthought/cucumber-reporting/issues/88#issuecomment-91555285 .

cwcharaka commented 9 years ago

Hi, I m having the same error. Need some help on this.

FATAL: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:34) at net.masterthought.cucumber.ReportParser.(ReportParser.java:24) at net.masterthought.cucumber.ReportBuilder.(ReportBuilder.java:77) at net.masterthought.****.CucumberReportPublisher.perform(CucumberReportPublisher.java:109) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:754) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:707) at hudson.model.Run.execute(Run.java:1690) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:246)

hangvar commented 9 years ago

Any idea when you have time to look into this?

damianszczepanik commented 9 years ago

Can you attach json file? I will take a look and check with #head version

wokier commented 9 years ago

Hi We had the same error yesterday with Jenkins Cucumber plugin v0.1.0, Jenkins v1.538 The Fileutils.sizeOf(File) method exists since commons-io 2.0 The pom.xml indicates using commons-io 2.3, but this stack shows another one is used at runtime.

damianszczepanik commented 9 years ago

Does not look like cucumber plugin problem but if you want me to investigate that problem you need to attach json file and settings you have used on Jenkins

rmpestano commented 9 years ago

Hi there, same happens here.

here's our .json file:

http://pastebin.com/WtRQSZRu

and jenkins output:

Finished Calculation of disk usage of workspace in 0 seconds [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 02:57 min [INFO] Finished at: 2015-05-28T16:20:59-03:00 [INFO] Final Memory: 34M/865M [INFO] ------------------------------------------------------------------------ Waiting for Jenkins to finish collecting data [JENKINS] Archiving /var/procergs/jenkins/workspace/apm-funcional/pom.xml to com.procergs.apm/apm-arq4/0.10.1-SNAPSHOT/apm-arq4-0.10.1-SNAPSHOT.pom channel stopped [CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] Copying all json files from: /var/procergs/jenkins/workspace/apm-funcional to reports directory: /var/procergs/jenkins/jobs/apm-funcional/builds/2015-05-28_16-17-57/cucumber-html-reports [CucumberReportPublisher] Found 1 json files. [CucumberReportPublisher] 0. Found a json file: target/cucumber-report/com.procergs.test.acceptance.aluno.AlunoPesquisarAt.json [CucumberReportPublisher] Generating HTML reports FATAL: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:35) at net.masterthought.cucumber.ReportParser.(ReportParser.java:24) at net.masterthought.cucumber.ReportBuilder.(ReportBuilder.java:128) at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:124) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1046) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706) at hudson.model.Run.execute(Run.java:1703) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231)

rmpestano commented 9 years ago

Hi again, I can confirm that it works on my local environment, the main difference from my company's environment is jenkins version:

It should be the issue?

damianszczepanik commented 9 years ago

If you use the same cucumber-plugin locally and at company's server that means that it's not probably cucumber issue. I can't help you in this case since I'm not good at Jenkins but what I would suggest is to check changelog of the Jenkins between those two versions.

rmpestano commented 9 years ago

Yea, updating jenkins here at the company also solves the problem (we are using v 1.616).

balareddy commented 9 years ago

I am using Jenkins ver. 1.535 and the plugin version is net.masterthought:cucumber-reporting:0.1.0. On running Jenkins with this plugin, following error is seen. Is there a workaround for this issue without upgrading the Jenkins version? Would any older plugin versions work? Would appreciate a resolution to the issue.

[CucumberReportPublisher] Compiling Cucumber Html Reports ... [CucumberReportPublisher] Copying all json files from slave: XXXXXX/target to master reports directory: XXXX/builds/2015-06-18_17-58-02/cucumber-html-reports [CucumberReportPublisher] Found 1 json files. [CucumberReportPublisher] 0. Found a json file: cucumber-report.json [CucumberReportPublisher] Generating HTML reports FATAL: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.sizeOf(Ljava/io/File;)J at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:35) at net.masterthought.cucumber.ReportParser.(ReportParser.java:24) at net.masterthought.cucumber.ReportBuilder.(ReportBuilder.java:128) at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:124) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:781) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:753) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706) at hudson.model.Run.execute(Run.java:1690) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:246)

this is the dependency for net.masterthought:cucumber-reporting:0.1.0.

--- net.masterthought:cucumber-reporting:0.1.0 +--- com.google.code.gson:gson:2.2.4 +--- org.apache.velocity:velocity:1.7 | +--- commons-collections:commons-collections:3.2.1 | --- commons-lang:commons-lang:2.4 +--- velocity-tools:velocity-tools:1.4 +--- joda-time:joda-time:2.1 +--- com.google.guava:guava:r09 -> 18.0 +--- org.mockito:mockito-all:1.9.0 -> 1.10.19 +--- commons-io:commons-io:2.3 +--- org.apache.maven.plugins:maven-gpg-plugin:1.4 | +--- org.apache.maven:maven-plugin-api:2.0.6 | +--- org.apache.maven:maven-project:2.0.6 | | +--- org.apache.maven:maven-settings:2.0.6 | | | +--- org.apache.maven:maven-model:2.0.6 | | | | --- org.codehaus.plexus:plexus-utils:1.4.1 -> 2.0.5 | | | --- org.codehaus.plexus:plexus-utils:1.4.1 -> 2.0.5 | | +--- org.apache.maven:maven-profile:2.0.6 | | | +--- org.apache.maven:maven-model:2.0.6 () | | | --- org.codehaus.plexus:plexus-utils:1.4.1 -> 2.0.5 | | +--- org.apache.maven:maven-model:2.0.6 () | | +--- org.apache.maven:maven-artifact-manager:2.0.6 | | | +--- org.apache.maven:maven-repository-metadata:2.0.6 | | | | --- org.codehaus.plexus:plexus-utils:1.4.1 -> 2.0.5 | | | +--- org.codehaus.plexus:plexus-utils:1.4.1 -> 2.0.5 | | | +--- org.apache.maven:maven-artifact:2.0.6 | | | | --- org.codehaus.plexus:plexus-utils:1.4.1 -> 2.0.5 | | | --- org.apache.maven.wagon:wagon-provider-api:1.0-beta-2 | | | --- org.codehaus.plexus:plexus-utils:1.0.4 -> 2.0.5 | | +--- org.apache.maven:maven-plugin-registry:2.0.6 | | | --- org.codehaus.plexus:plexus-utils:1.4.1 -> 2.0.5 | | +--- org.codehaus.plexus:plexus-utils:1.4.1 -> 2.0.5 | | --- org.apache.maven:maven-artifact:2.0.6 () | +--- org.apache.maven:maven-artifact:2.0.6 () | +--- org.apache.maven:maven-model:2.0.6 (*) | --- org.codehaus.plexus:plexus-utils:2.0.5 +--- com.googlecode.totallylazy:totallylazy:1.20 --- org.jsoup:jsoup:1.7.2

damianszczepanik commented 9 years ago

Since I cannot reproduce it and this is Jenkins problem not plugin it's hard to say whether it works with older versions. I expect not because this library was not added recently.