question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There was an error in the forked process

See original GitHub issue

Hello, I’ve tried to migrate my project from jdk 1.6 to jdk 1.7, but faced with following issue:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project test: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test failed: There was an error in the forked process
[ERROR] java.lang.NullPointerException
[ERROR] at java.lang.String.length(String.java:623)
[ERROR] at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:414)
[ERROR] at java.lang.StringBuffer.append(StringBuffer.java:237)
[ERROR] at org.testng.reporters.TestHTMLReporter.generateTable(TestHTMLReporter.java:114)
[ERROR] at org.testng.reporters.TestHTMLReporter.generateLog(TestHTMLReporter.java:305)
[ERROR] at org.testng.reporters.TestHTMLReporter.onFinish(TestHTMLReporter.java:40)
[ERROR] at org.testng.TestRunner.fireEvent(TestRunner.java:1241)
[ERROR] at org.testng.TestRunner.afterRun(TestRunner.java:1032)
[ERROR] at org.testng.TestRunner.run(TestRunner.java:621)
[ERROR] at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
[ERROR] at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
[ERROR] at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
[ERROR] at org.testng.SuiteRunner.run(SuiteRunner.java:240)
[ERROR] at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
[ERROR] at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
[ERROR] at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
[ERROR] at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
[ERROR] at org.testng.TestNG.run(TestNG.java:1057)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:91)
[ERROR] at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:204)
[ERROR] at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:107)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:113)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
[ERROR] -> [Help 1]

I’m not sure is this a testng problem. Please close issue, if not. P.S. jdk: 1.7.0_25 maven: 3.0.5 maven-surfire-plugin: 2.16

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:60 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
praveentatacommented, Apr 26, 2018

Hi,

I am updating my JDK from 1.7 to 1.8. There are no compilation errors. - mvn clean compile test-compile works fine. Below are the versions of dependencies which I am using: TestNG - 6.14.3 (We were on 6.9.10) Maven Surefire Plugin - 2.21.0 Maven Compiler Plugin - 3.0

We have a QA framework which is introduced as dependency in pom.xml in all our projects. We have testng depdendency in QA framework pom.xml as well :

<dependency>
	<groupId>org.testng</groupId>
	<artifactId>testng</artifactId>
	<version>6.14.3</version>
	<scope>test</scope>
</dependency>

When I do mvn install, I get the following error:

[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] 
[ERROR] The test(s) <[]> cannot be found.
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:658)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1149)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:978)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:854)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[ERROR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

When I try to run my test project via testng.xml or just a single test class, I get the following error:

[RemoteTestNG] detected TestNG version 6.14.3
org.testng.TestNGException: 
The test(s) <[${test}]> cannot be found.
	at org.testng.TestNG.parseSuite(TestNG.java:312)
	at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:348)
	at org.testng.TestNG.initializeEverything(TestNG.java:995)
	at org.testng.remote.support.RemoteTestNG6_12.initialize(RemoteTestNG6_12.java:22)
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:97)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

Can someone tell me what am I doing wrong?

Thanks in advance.

0reactions
Mastro812commented, Mar 15, 2022

Thank you, Sir, the error is solved…

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to fix the maven surefire plugin error [there was error in ...
Actually i have given the wrong testNG.xml path in POM.XML that's why it was throwing me that error. Please cross verify your testNG.xml...
Read more >
Getting There was an error in the forked process error while ...
Surefire is basically saying that the class instantiation itself failed. Usually happens when you have a constructor that threw an exception or when...
Read more >
[#SUREFIRE-1426] Fork crash doesn't fail build with - Apache
SurefireBooterForkException: There was an error in the forked process Unable to load category: stress at org.apache.maven.plugin.surefire.booterclient.
Read more >
There was an error in the forked process, upon build project
I have created the POM with Page factory set up and tried to build that project and getting the below error. please help...
Read more >
[testng-users] TestNGException while executing mavenized ...
goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test failed: There was an error in the forked process [ERROR] org.testng.TestNGException:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found