Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in HTMLFormatter #283

Closed
aslakhellesoy opened this issue Mar 30, 2012 · 10 comments
Closed

NullPointerException in HTMLFormatter #283

aslakhellesoy opened this issue Mar 30, 2012 · 10 comments

Comments

@aslakhellesoy
Copy link
Contributor

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.

@aslakhellesoy
Copy link
Contributor Author

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)

@dkowis
Copy link
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.

@dkowis
Copy link
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 :)

@cedric-lamalle
Copy link
Contributor

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
Copy link

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
Copy link

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.

@aslakhellesoy
Copy link
Contributor Author

This should be fixed in 1.1.1.

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants