Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

NullPointer when generating HTML report #2

Closed
jeremyGoupil opened this Issue · 30 comments

4 participants

@jeremyGoupil

Hi,

I have this little problem :

[CucumberReportPublisher] Compiling Cucumber Html Reports ...
[CucumberReportPublisher] copying json to reports directory: /data/jenkins/jobs/test-modules-cucumber-jvm/builds/2012-04-25_17-21-39/cucumber-html-reports
[CucumberReportPublisher] Generating HTML reports
ERROR: Publisher net.masterthought.jenkins.CucumberReportPublisher aborted due to exception
java.lang.NullPointerException
at net.masterthought.jenkins.FeatureReportGenerator.getAllStepStatuses(FeatureReportGenerator.java:131)
at net.masterthought.jenkins.FeatureReportGenerator.(FeatureReportGenerator.java:29)
at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:71)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:692)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:667)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:989)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:614)
at hudson.model.Run.run(Run.java:1429)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:478)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:230)

Could you help ?

I try to fork and correct this by my self but when I try to build I obtain that :

[INFO] Failed to resolve artifact.

Missing:

1) org.kohsuke.stapler:stapler-groovy:jar:1.169

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.kohsuke.stapler -DartifactId=stapler-groovy -Dversion=1.169 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.kohsuke.stapler -DartifactId=stapler-groovy -Dversion=1.169 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) org.jenkins-ci.tools:maven-hpi-plugin:maven-plugin:1.74
2) org.kohsuke.stapler:stapler-groovy:jar:1.169

2) org.kohsuke.stapler:stapler-jelly:jar:1.169

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.kohsuke.stapler -DartifactId=stapler-jelly -Dversion=1.169 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.kohsuke.stapler -DartifactId=stapler-jelly -Dversion=1.169 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) org.jenkins-ci.tools:maven-hpi-plugin:maven-plugin:1.74
2) org.kohsuke.stapler:stapler-groovy:jar:1.169
3) org.kohsuke.stapler:stapler-jelly:jar:1.169


2 required artifacts are missing.

for artifact:
org.jenkins-ci.tools:maven-hpi-plugin:maven-plugin:1.74

from the specified remote repositories:
public (http://mvnrepository.adencf.local/nexus/content/groups/public),
repo.jenkins-ci.org (http://repo.jenkins-ci.org/public/),
central (http://repo1.maven.org/maven2),
sonatype-snapshots (https://oss.sonatype.org/content/repositories/snapshots),
public-snapshots (http://mvnrepository.adencf.local/nexus/content/groups/public-snapshots)

@kingsleyh kingsleyh was assigned
@kingsleyh
Owner

Hi - I will check into the first issue of not being able to generate the HTML reports as well.

Your second issue of not being able to build the project is probably because you need to put some config in your maven settings in your .m2 directory - have a look on this page for the xml:

https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial

@kingsleyh
Owner

Also - could you give me more details about the type of jenkins project you made? Is it a regular freestyle project or something else? Also what operating system are you running on and which version of Jenkins do you have?

@kingsleyh
Owner

Oh my code assumes you have either a scenario or a scenario outline at least. Maybe you can give an example of the feature file you are using. I should make some changes to handle when there are no feature and scenario keyword.

@kingsleyh
Owner

I have just done some investigation - and it seems with cucumber-jvm you must supply the feature keyword and a scenario keyword at least. But your error message seems consistent with the scenario keyword missing.

@jeremyGoupil

Hi,

We use Jenkins ver. 1.440, on Debian linux.

We use Feature: text

resume text
Scenario:
Given contextStep
Scenario: description text
When stepA
Then stepB :
| verify A | verify B |

@jeremyGoupil

Feature are UTF-8 encoding style we use french word for the description like "démarre" is that a problem ?

@kingsleyh
Owner

Hi - ok then this seems fine. I have version 1.456 - and I use a freestyle project. It doesn't seem to work for other project types - e.g the maven project type.

@kingsleyh
Owner

I'm not sure about the french word description - you'll have to experiment and see if that is causing the issue.

@jeremyGoupil

Can you publish your freetyle project configuration or an example ?

@kingsleyh
Owner

my freestyle project config is very simple - I only have 4 things:

  1. the project name (which is mandatory)
  2. In Advanced project options I set the custom workspace to point to my project directory when running locally Or if running on the build server I just set the source control to check out my repo
  3. I add a build step - execute shell - which has mvn clean install
  4. I tick the cucumber-reports plugin and put target in the first field and leave the second one empty

Thats pretty much it

@jeremyGoupil

I try with feestyle type project and have the same issue.

I leave the second one empty but we are in this configuration host:port/jenkins/ and i don't get what to put in,
i try host:port/jenkins/cucumber-reports

@kingsleyh
Owner
@jeremyGoupil

The same issue :

[CucumberReportPublisher] Compiling Cucumber Html Reports ...

[CucumberReportPublisher] copying json to reports directory: /data/jenkins/jobs/cucumber-jvm-with-reports/builds/2012-04-26_11-27-25/cucumber-html-reports
[CucumberReportPublisher] Generating HTML reports
ERROR: Publisher net.masterthought.jenkins.CucumberReportPublisher aborted due to exception
java.lang.NullPointerException
at net.masterthought.jenkins.FeatureReportGenerator.getAllStepStatuses(FeatureReportGenerator.java:131)
at net.masterthought.jenkins.FeatureReportGenerator.(FeatureReportGenerator.java:29)
at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:71)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:692)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:667)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:645)
at hudson.model.Build$RunnerImpl.post2(Build.java:162)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:614)
at hudson.model.Run.run(Run.java:1429)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:230)

@kingsleyh
Owner
@kingsleyh
Owner
@jeremyGoupil

ok thx you're reactivity !

@kingsleyh
Owner

Hi,

I fixed your problem - so it should work now. Let me know if you have any other issues. I also added duration to this version - it's in the download section.

@kingsleyh kingsleyh closed this
@jeremyGoupil

Hi,

I have always the same issue, you're sources are encoding in UTF-8 or ISO-8859-15 ?

@kingsleyh
Owner
@jeremyGoupil

Yes I did download version 0.0.5 of the plugin and my cucumber-jvm version is the 1.0.4.

@jeremyGoupil

Hello, it works.
It was configuration problem and cucumber-jvm reporter problem.

Big thank's you for you're help.

@czulehner

Hi,

got the same issue with NPE.

As we also use the feature files for documentation, not all of our feature files include a scenario. Cucumber-jvm itself does not have a problem with those files and generates the JSON Files propberly.

So any chance, that the report plugin also supports relaxed parsing and allows feature files without a scenario?

@kingsleyh
Owner
@czulehner

Hi,
just sent you a file...
thanx in advance
Chris

@czulehner

Hi,
just sent you a file...
thanx in advance
Chris

@kingsleyh
Owner
@czulehner

Downloaded and installed it. Had to remove old plugin versions first, Jenkins didn't recognize the new version.

Seems to work like a charm now!

Thanks a lot!

@kingsleyh
Owner
@ChaitanyaChannella

I'm having a similar issue,m here is what I get in the console output

[CucumberReportPublisher] Compiling Cucumber Html Reports ...
[CucumberReportPublisher] copying all json files from slave: /var/jenkins/workspace/Allure_test_job to master reports directory: /var/lib/jenkins/jobs/Allure_test_job/builds/2015-01-23_15-51-16/cucumber-html-reports
[CucumberReportPublisher] Found the following number of json files: 1
[CucumberReportPublisher] 0. Found a json file: results.json
[CucumberReportPublisher] Generating HTML reports
[CucumberReportPublisher] there was an error generating the reports: java.lang.NullPointerException
net.masterthought.cucumber.ReportBuilder.getBuildStatus(ReportBuilder.java:76)
net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:112)
hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
hudson.model.Build$BuildExecution.post2(Build.java:183)
hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
hudson.model.Run.execute(Run.java:1784)
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
hudson.model.ResourceController.execute(ResourceController.java:89)
hudson.model.Executor.run(Executor.java:240)

I would appreciate any ideas or suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.