You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Xu, Larry" <le...@ebay.com> on 2010/09/08 03:44:01 UTC

forked jvm exited abnormally

Hi All,
I met a trick problem "forked jvm exited abnormally".

I ran the JUnit test case in ant and set the fork=yes for getting EMMA report.

But I met the above problem.
When I set back the fork=no , it work well.
Then I asked Google, there are so many question on the network.
It seems a popular issue.
Someone said it is fixed bug in Ant 1.7.1. It caused the multiple version of Ant or JUnit.
In Ant1.7.1 , it will give you a tips to said multiple version of Ant or JUnit exist.

But I still got the problem "forked jvm exited abnormally" after I clean up the classpath until the there is no more warning for multiple version of Ant or JUnit exist.

Do you have any idea on that?

Env
JUnit 4.8
Ant1.8.1
JDK1.6

Thanks
Best Regards
Larry



Re: forked jvm exited abnormally

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-09-08, Xu, Larry wrote:

> JUnit output:
> Testsuite: com.ebay.ice.kernel.unittest.AllTests
> Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

> Testcase: null took 0 sec
>                 Caused an ERROR
> Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
> junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.

OK, this means the VM crashed somewhere inside the AllTests suite (which
likely is pretty big).

> Is there any way to get more detail log?

Not that easily.  When you fork a test Ant buffers all information
inside the forked VM and only emits it at the end - the loggers write
their information as part of the suiteFinished event and not earlier.

You can set showOutput to true to make sure anything that goes to
System.out/err is visible inside Ant's log, maybe there is something
useful.

If that doesn't help the best idea I can come up with is splitting the
test suite into smaller ones and/or inserting printlns until I know
which test causes the problem.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: forked jvm exited abnormally

Posted by "Xu, Larry" <le...@ebay.com>.
HI Stefan,
Sincerely thanks for your reply.
As you said, I have added a format ‘Plain’ in the junit task and check the ant log and output of unit test.
But I can’t find not any useful info.
Ant log:
    [junit] Scanning for classes: Time=[0.219 seconds] Found=[1 classes]
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.016 sec
    [junit] EMMA: runtime coverage data merged into [c:\emma\coverage.ec] {in 31 ms}
    [junit] Running com.ebay.ice.kernel.unittest.AllTests
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] Test com.ebay.ice.kernel.unittest.AllTests FAILED (crashed)

JUnit output: 
Testsuite: com.ebay.ice.kernel.unittest.AllTests
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

Testcase: null took 0 sec
                Caused an ERROR
Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.


Is there any way to get more detail log?
Best Regards
Larry

Best Regards
Larry


-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: 2010年9月8日 12:15
To: user@ant.apache.org
Subject: Re: forked jvm exited abnormally

On 2010-09-08, Xu, Larry wrote:

> I met a trick problem "forked jvm exited abnormally".

> I ran the JUnit test case in ant and set the fork=yes for getting EMMA
> report.

This can happen for a number of reasons, the most likely is that an
exception is thrown during your tests that terminate the VM - a good
candidate is an OutOfMemoryException.  It could also be a test invoking
System.exit or any other reason that stops a Java VM.

> When I set back the fork=no , it work well.

Your forked VM may start with different memory settings than the one
running Ant, for example.

> Someone said it is fixed bug in Ant 1.7.1. It caused the multiple
> version of Ant or JUnit.

Later in your mail you say you are using Ant 1.8.1.

> In Ant1.7.1 , it will give you a tips to said multiple version of Ant
> or JUnit exist.

I don't think this would cause the forked VM to crash.

Does the forked VM really crash or is the message wrong?  If it crashes,
can you identify the reason in some way?  Add a verbose formatter (like
plain), make sure all output goes to Ant's logging system and to a file
so you get as much of information as possible.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: forked jvm exited abnormally

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-09-08, Xu, Larry wrote:

> I met a trick problem "forked jvm exited abnormally".

> I ran the JUnit test case in ant and set the fork=yes for getting EMMA
> report.

This can happen for a number of reasons, the most likely is that an
exception is thrown during your tests that terminate the VM - a good
candidate is an OutOfMemoryException.  It could also be a test invoking
System.exit or any other reason that stops a Java VM.

> When I set back the fork=no , it work well.

Your forked VM may start with different memory settings than the one
running Ant, for example.

> Someone said it is fixed bug in Ant 1.7.1. It caused the multiple
> version of Ant or JUnit.

Later in your mail you say you are using Ant 1.8.1.

> In Ant1.7.1 , it will give you a tips to said multiple version of Ant
> or JUnit exist.

I don't think this would cause the forked VM to crash.

Does the forked VM really crash or is the message wrong?  If it crashes,
can you identify the reason in some way?  Add a verbose formatter (like
plain), make sure all output goes to Ant's logging system and to a file
so you get as much of information as possible.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org