Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

NullPointerException in HTMLFormatter #283

Closed
aslakhellesoy opened this Issue Mar 30, 2012 · 9 comments

Comments

Projects
None yet
5 participants
Owner

aslakhellesoy commented Mar 30, 2012

From Shenoy Venugopal on my blog

java.lang.reflect.UndeclaredThrowableException
at $Proxy12.done(Unknown Source)
at cucumber.junit.JUnitReporter.done(JUnitReporter.java:141)
at cucumber.junit.Cucumber.run(Cucumber.java:81)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:90)
... 9 more
Caused by: java.lang.NullPointerException
at cucumber.formatter.HTMLFormatter.writeBytes(HTMLFormatter.java:161)
at cucumber.formatter.HTMLFormatter.copyReportFiles(HTMLFormatter.java:154)
at cucumber.formatter.HTMLFormatter.done(HTMLFormatter.java:107)
... 14 more

I assume he is using Cucumber-JVM 1.0.0 or 1.0.1, and the helloworld example.

Owner

aslakhellesoy commented Mar 30, 2012

I tried to reproduce this, but I don't have enough information about how to reproduce it. Things that would help to know:

  • Exactly what files were generated.
  • What cucumber version was used.
  • Does it fail from the command line using Maven? (It didn't for me)
  • Does it fail in Eclipse? (I haven't tried this yet)
  • Does it fail in IntelliJ IDEA? (it didn't for me)
Member

dkowis commented Mar 30, 2012

It might be a before/after hook failing like the other problems. I suspect it's related to the Exception Swallowing problem that I've been working on. This might be a different location, however.

Member

dkowis commented Mar 30, 2012

Heh, nope, Slow laptop is still booting. I was just noticing a pattern in the stack trace that seemed similar to the other failures. Looking at those parts, it's probably not related at all :)

Member

cedric-lamalle commented Mar 31, 2012

We don't have environment info too like operating system. in would be null only if the resource can not be found: http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html#getResourceAsStream%28java.lang.String%29

Neat commented Apr 4, 2012

Hi, I got the same problem and I managed to get it right by remove @Cucumber.Options(format = {"pretty", "html:target/cucumber"}).
Step to create,
I have created the new project on eclipse and add jar file v1.0.1 as dependency
I create feature file and RunCukesTest.java file with the option above and got the error occur

Neat commented Apr 4, 2012

Hi, I found the root cause. Actually I need to add another lib called cucumber-html to get this option right.

Owner

aslakhellesoy commented Oct 26, 2012

This should be fixed in 1.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment