Module8 - Ant run error - Process Fork failed | Selenium Forum
M
Posted on 31/03/2016
Hi Ashish,
In Module8 while executing "ant run", i'm getting error Process Fork failed.

Could you suggest a fix as I cannot proceed further?

PS:
I have already added JAVA_HOME variable pointing to JDK. Even after adding it, getting same error.
[quote:2dke2u91]

-----last few lines of running "ant compile"
[javac] C:\Selenium\SeleniumWorkspace\Module08_Junit_Ant\build.xml:79: warning: 'includeantruntime' was not set, defaultin
ble builds
[javac] Compiling 6 source files to C:\Selenium\SeleniumWorkspace\Module08_Junit_Ant\build

BUILD SUCCESSFUL
Total time: 6 seconds

C:\Selenium\SeleniumWorkspace\Module08_Junit_Ant>ant run
Buildfile: C:\Selenium\SeleniumWorkspace\Module08_Junit_Ant\build.xml

run:
[junit] Running testcases.FirstTestCase
[junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec

BUILD FAILED
[b:2dke2u91]C:\Selenium\SeleniumWorkspace\Module08_Junit_Ant\build.xml:107:[color=#FF0000:2dke2u91] Process fork failed[/color:2dke2u91].[/b:2dke2u91]

Total time: 6 seconds

C:\Selenium\SeleniumWorkspace\Module08_Junit_Ant>[/quote:2dke2u91]

[b:2dke2u91]Build.xml file snippet[/b:2dke2u91]

[quote:2dke2u91]<property name="ws.home" value="${basedir}"/>
<property name="ws.jars" value="C:\Selenium\eclipse-jee-mars-1-win32\plugins"/>
<property name="test.dest" value="${ws.home}/build"/>
<property name="test.src" value="${ws.home}/src"/>
<property name="test.reportsDir" value="C:\Selenium\SeleniumWorkspace\Module08_Junit_Ant\AntReports"/>

<javac
debug="true"
destdir="${test.dest}"
srcdir="${test.src}"
[b:2dke2u91] target="1.8" [/b:2dke2u91]
classpath="${test.classpath}"
>
</javac>

[/quote:2dke2u91]

[quote:2dke2u91]<target name="run" >
<delete includeemptydirs="true" quiet="true">
<fileset dir="${test.reportsDir}" includes="**/*"/>
</delete>
<java jar="${ws.jars}" fork="true" spawn="true" />
[b:2dke2u91][color=#FF0000:2dke2u91]line107------>>>>>>[/color:2dke2u91][/b:2dke2u91] <junit fork="yes" haltonfailure="no" printsummary="yes">
<classpath refid="testcase.path" /> [/quote:2dke2u91]

M
Replied on 31/03/2016

Please remove unnecessary jar files from Classpath and try.


M
Replied on 01/04/2016

[quote="qtpselenium.supp0rt@gmail.com":2fa15wpj]Please remove unnecessary jar files from Classpath and try.[/quote:2fa15wpj]

Can you tell me what all are unnecessary jar files to be removed?


M
Replied on 01/04/2016

[quote="giteshr15":1wdjkm42][quote="qtpselenium.supp0rt@gmail.com":1wdjkm42]Please remove unnecessary jar files from Classpath and try.[/quote:1wdjkm42]

Can you tell me what all are unnecessary jar files to be removed?[/quote:1wdjkm42]


I'm able to solve the problem, however have a question.

I created a separate folder for jars and added the jars used till module8.
Now the compile fails due to missing Junit jar.
Added Junit jar and run passes with failed entries for all testcases - reason initializationError.
Again added hamcrest jar and run went through successfully.

[b:1wdjkm42]Question:[/b:1wdjkm42]
Why Junit jar is required to be added separately for Ant? I didn't find one in the jars folder downloaded with the code. So how the compilation went flawlessly for you in the video? Responsive image

Same question on hamcrest jar


M
Replied on 01/04/2016

these kinds of bugs are common in open source software. problem is the interaction with different jar files.