Process fork failed - at org.testng.TestNGAntTask.executeAsForked(TestNGAntTask.java:824)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Process fork failed - at org.testng.TestNGAntTask.executeAsForked(TestNGAntTask.java:824)

Sam-241
Hi All,

I am not sure what is the issue but my ant build script is getting
failed with below error :
My classpath is huge and I assume it is getting failed because of that
but how to solve this?

From past 6 hours I was working on this but couldn't solve, can you
please help me out?

C:\CR\uibuild.xml:76: Process fork failed.
at org.testng.TestNGAntTask.executeAsForked(TestNGAntTask.java:824)
at org.testng.TestNGAntTask.execute(TestNGAntTask.java:521)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
....
....

Below is my Ant Build.xml

<project name="Build-Jenkins" default="run" basedir=".">

        <import file="build.xml"/>

        <property name="uibuild.dir" location="${basedir}/source/tests/build"/
>
        <property name="uilib.dir" location="${basedir}/source/tests/lib"/>
        <property name="uisrc.dir"  location="${basedir}/source/tests/src"/>

        <taskdef resource="testngtasks" classpath="./source/tests/lib/
testng-6.4.jar"/>

        <target name="setClassPath">
                <path id ="classpath_jars">
                        <pathelement path = "${basedir}/"/>

                        <fileset dir = "${uilib.dir}" includes = "*.jar"/>

                        <fileset dir="lib/j2ee">
                                <include name="*.jar"/>
                        </fileset>

                        <fileset dir="source/carrentals-web/WEB-INF/src/com/CR/">
                                <include name="**/*.java"/>
                        </fileset>

                </path>
                <pathconvert pathsep = ";" property="test.classpath"
refid="classpath_jars"/>
        </target>

        <target name = "uiinit">
                <mkdir dir = "${uibuild.dir}" />
        </target>

        <target name = "uiclean">
                <delete dir ="${uibuild.dir}"/>
        </target>

        <target name="uicompile" depends="uiclean, uiinit, setClassPath"
                        description="compile the source " >

                <antcall target="compile" />

                <echo message=" Now running Run target with Class Path: $
{test.classpath}:${build.dir}"/>
                <javac srcdir="${uisrc.dir}" destdir="${uibuild.dir}" debug="true">
                        <classpath>
                                <fileset dir="${web.dir}/WEB-INF/lib">
                                        <include name="*.jar"/>
                                </fileset>

                                <fileset dir="lib/j2ee">
                                        <include name="*.jar"/>
                                </fileset>
                                <fileset dir = "${uilib.dir}" includes = "*.jar"/>
                        </classpath>
                        <include name="**/*.java"/>
                </javac>
        </target>

        <target name="run" depends="uicompile"
                        description="run the testng xml file">
                <testng classpath = "${test.classpath};${uibuild.dir}">
                        <xmlfileset dir="${basedir}/source/tests" includes = "testng.xml" /
>
                </testng>
        </target>
</project>

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: Process fork failed - at org.testng.TestNGAntTask.executeAsForked(TestNGAntTask.java:824)

amitaks2
This may be because your M2_REPO directory have so many jars and may exceeds the classpath size or something like that.

The same problem I faced and resolved by extracting relevant jars to some other location and given that path only.

I hope that would work for you.

Thanks
-AMIT

On Friday, June 29, 2012 12:12:50 PM UTC+5:30, Sam wrote:
Hi All,

I am not sure what is the issue but my ant build script is getting
failed with below error :
My classpath is huge and I assume it is getting failed because of that
but how to solve this?

From past 6 hours I was working on this but couldn't solve, can you
please help me out?

C:\CR\uibuild.xml:76: Process fork failed.
at org.testng.TestNGAntTask.executeAsForked(TestNGAntTask.java:824)
at org.testng.TestNGAntTask.execute(TestNGAntTask.java:521)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
....
....

Below is my Ant Build.xml

<project name="Build-Jenkins" default="run" basedir=".">

        <import file="build.xml"/>

        <property name="uibuild.dir" location="${basedir}/source/tests/build"/
>
        <property name="uilib.dir" location="${basedir}/source/tests/lib"/>
        <property name="uisrc.dir"  location="${basedir}/source/tests/src"/>

        <taskdef resource="testngtasks" classpath="./source/tests/lib/
testng-6.4.jar"/>

        <target name="setClassPath">
                <path id ="classpath_jars">
                        <pathelement path = "${basedir}/"/>

                        <fileset dir = "${uilib.dir}" includes = "*.jar"/>

                        <fileset dir="lib/j2ee">
                                <include name="*.jar"/>
                        </fileset>

                        <fileset dir="source/carrentals-web/WEB-INF/src/com/CR/">
                                <include name="**/*.java"/>
                        </fileset>

                </path>
                <pathconvert pathsep = ";" property="test.classpath"
refid="classpath_jars"/>
        </target>

        <target name = "uiinit">
                <mkdir dir = "${uibuild.dir}" />
        </target>

        <target name = "uiclean">
                <delete dir ="${uibuild.dir}"/>
        </target>

        <target name="uicompile" depends="uiclean, uiinit, setClassPath"
                        description="compile the source " >

                <antcall target="compile" />

                <echo message=" Now running Run target with Class Path: $
{test.classpath}:${build.dir}"/>
                <javac srcdir="${uisrc.dir}" destdir="${uibuild.dir}" debug="true">
                        <classpath>
                                <fileset dir="${web.dir}/WEB-INF/lib">
                                        <include name="*.jar"/>
                                </fileset>

                                <fileset dir="lib/j2ee">
                                        <include name="*.jar"/>
                                </fileset>
                                <fileset dir = "${uilib.dir}" includes = "*.jar"/>
                        </classpath>
                        <include name="**/*.java"/>
                </javac>
        </target>

        <target name="run" depends="uicompile"
                        description="run the testng xml file">
                <testng classpath = "${test.classpath};${uibuild.dir}">
                        <xmlfileset dir="${basedir}/source/tests" includes = "testng.xml" /
>
                </testng>
        </target>
</project>

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/f3DMk3piOt8J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Process fork failed - at org.testng.TestNGAntTask.executeAsForked(TestNGAntTask.java:824)

Madiraju K Chaitanya
In reply to this post by Sam-241
Hi Amit Singh Ji,
Your solution for the above problem worked for me, by removing unnecessary jar files and also shortening the classpath where the files are located.
Thank You.

On Friday, 29 June 2012 12:12:50 UTC+5:30, Sam wrote:
Hi All,

I am not sure what is the issue but my ant build script is getting
failed with below error :
My classpath is huge and I assume it is getting failed because of that
but how to solve this?

From past 6 hours I was working on this but couldn't solve, can you
please help me out?

C:\CR\uibuild.xml:76: Process fork failed.
at org.testng.TestNGAntTask.executeAsForked(TestNGAntTask.java:824)
at org.testng.TestNGAntTask.execute(TestNGAntTask.java:521)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
....
....

Below is my Ant Build.xml

<project name="Build-Jenkins" default="run" basedir=".">

        <import file="build.xml"/>

        <property name="uibuild.dir" location="${basedir}/source/tests/build"/
>
        <property name="uilib.dir" location="${basedir}/source/tests/lib"/>
        <property name="uisrc.dir"  location="${basedir}/source/tests/src"/>

        <taskdef resource="testngtasks" classpath="./source/tests/lib/
testng-6.4.jar"/>

        <target name="setClassPath">
                <path id ="classpath_jars">
                        <pathelement path = "${basedir}/"/>

                        <fileset dir = "${uilib.dir}" includes = "*.jar"/>

                        <fileset dir="lib/j2ee">
                                <include name="*.jar"/>
                        </fileset>

                        <fileset dir="source/carrentals-web/WEB-INF/src/com/CR/">
                                <include name="**/*.java"/>
                        </fileset>

                </path>
                <pathconvert pathsep = ";" property="test.classpath"
refid="classpath_jars"/>
        </target>

        <target name = "uiinit">
                <mkdir dir = "${uibuild.dir}" />
        </target>

        <target name = "uiclean">
                <delete dir ="${uibuild.dir}"/>
        </target>

        <target name="uicompile" depends="uiclean, uiinit, setClassPath"
                        description="compile the source " >

                <antcall target="compile" />

                <echo message=" Now running Run target with Class Path: $
{test.classpath}:${build.dir}"/>
                <javac srcdir="${uisrc.dir}" destdir="${uibuild.dir}" debug="true">
                        <classpath>
                                <fileset dir="${web.dir}/WEB-INF/lib">
                                        <include name="*.jar"/>
                                </fileset>

                                <fileset dir="lib/j2ee">
                                        <include name="*.jar"/>
                                </fileset>
                                <fileset dir = "${uilib.dir}" includes = "*.jar"/>
                        </classpath>
                        <include name="**/*.java"/>
                </javac>
        </target>

        <target name="run" depends="uicompile"
                        description="run the testng xml file">
                <testng classpath = "${test.classpath};${uibuild.dir}">
                        <xmlfileset dir="${basedir}/source/tests" includes = "testng.xml" /
>
                </testng>
        </target>
</project>

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.