Hi, After detail investigation, I can prove this is a bug of maven surefire plugin, after version 2.12. That means from 2.12~2.17 it met the same problem.
The problem will happen in a special condition, you don't met any error during the test case execution time, however, you set the result to fail during IInvokedMethodListener#afterInovation, such as result.setStatus(Fail), Then maven surefire plugin will run ITestListener#onTestFailure method twice and throw a Null pointer exception. Currently, I rollback our plugin version to 2.12 to avoid this type of problem. Br, Tim -----Original Message----- From: kristian.rosenv...@zenior.no [mailto:kristian.rosenv...@zenior.no] On Behalf Of Kristian Rosenvold Sent: den 25 april 2014 07:42 To: Maven Users List Subject: Re: Maven sure fire plugin npe problem. It would appear that testng is not reporting the throwable that is cause of the failure. You might want to try a few different testNG versions to see if this is a recently introduced regression. Surefire should probably not NPE on this, but gaining some insight into the root cause is probably a good thing (tm). Kristian 2014-04-24 21:57 GMT+02:00 Tim Wu T <tim.t...@ericsson.com>: > Hi everyone, > > I am not sure if some of you met this problem before, we have some > smoke test in Jenkins sever, which will run some test case through > maven sure fire plugin, version is 2.17 > > But it will always throw an exception like this: > java.lang.NullPointerException > at > org.apache.maven.surefire.report.SmartStackTraceParser.<init>(SmartStackTraceParser.java:60) > at > org.apache.maven.surefire.report.PojoStackTraceWriter.smartTrimmedStackTrace(PojoStackTraceWriter.java:60) > at > org.apache.maven.surefire.booter.ForkingRunListener.encode(ForkingRunListener.java:328) > at > org.apache.maven.surefire.booter.ForkingRunListener.encode(ForkingRunListener.java:312) > at > org.apache.maven.surefire.booter.ForkingRunListener.toString(ForkingRunListener.java:258) > at > org.apache.maven.surefire.booter.ForkingRunListener.testFailed(ForkingRunListener.java:137) > at > org.apache.maven.surefire.testng.TestNGReporter.onTestFailure(TestNGReporter.java:105) > at org.testng.internal.Invoker.runTestListeners(Invoker.java:1901) > at org.testng.internal.Invoker.runTestListeners(Invoker.java:1885) > at org.testng.internal.Invoker.invokeMethod(Invoker.java:788) > at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:907) > at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1237) > at > org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127) > at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) > at org.testng.TestRunner.privateRun(TestRunner.java:767) > at org.testng.TestRunner.run(TestRunner.java:617) > at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) > at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) > at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) > at org.testng.SuiteRunner.run(SuiteRunner.java:240) > at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:51) > at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:85) > at org.testng.TestNG.runSuitesSequentially(TestNG.java:1197) > at org.testng.TestNG.runSuitesLocally(TestNG.java:1122) > at org.testng.TestNG.run(TestNG.java:1030) > at > org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:293) > at > org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84) > at > org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:91) > at > org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) > at > org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) > at > org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:1 > 03) > > > > I try to google something, but I don't get any good feedback. > > Thanks in advance. > > Br, > Tim > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org