Discussion:
"Forked Java VM exited abnormally" when running junit tests seperately
gerbenfeenstra
2011-05-11 10:21:23 UTC
Permalink
I'm working on a multi-module project using maven. When running all the tests for a module by right-clicking on the module and choose "test" (or building the whole project) testing finishes flawlessly. But when running a test separately I get this nasty exception for which I can't seem to find a solution on the net:


Code:
Testcase: my.test.class.java:null: 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.
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)



The few solutions I found in the internet (and tried) are:

- Eliminate the existence of any System.exit(0) calls (Which aren't present in our project in the first place)
- Set forkMode=once as a property of my project/module
- I've read somewhere the exception probably has an underlying problem like shortage of memory. So I tried increasing permsize and Xmx by passing "-Xmx512m -XX:MaxPermSize=512m" in MAVEN_OPTS environment variable. I also tried monitoring memory-usage with the JConsole, there is a spike when running the test, but nowhere near the maximum.

I am using Netbeans 7.0 RC2 (also tried 6.9) in conjunction with Java jdk1.6.0_24 which I reinstalled as well, tried x32 and x64 version. My hardware is more then sufficient and I have loads of memory on different machines (4 and 8GB). It fails on any test within our project if I run it seperately, also in debug test mode (Which is my main concern, debugging a test is impossible in this situation).

When creating a new project with a dummytest it succeeds, which led me to believe the problem is caused somewhere within our project or its settings rather then any java/maven settings.

Does anyone have any idea how to solve this problem? Did I miss something? Can I find a log somewhere which gives me some more info?
Jesse Glick
2011-05-11 23:57:14 UTC
Permalink
I'm working on a multi-module project using maven. When running all the tests for a module by right-clicking on the module and choose "test" (or building the whole
project) testing finishes flawlessly. But when running a test separately I get this nasty exception
If you figure out how to reproduce it from scratch, please file a bug report. In the meantime, try setting Compile on Save to Disable in the Run panel.
naveenkvm
2012-01-06 12:00:10 UTC
Permalink
We're also getting this problem with Netbeans 7.1 RC2 and JDK 1.6.0_25.
Following is the stacktrace we are getting:

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.
at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)

We are running integration test for a webservice.
When we right click and say 'Test File', it runs well.
But when we do 'Debug Test File' with a breakpoint, it comes to the
breakpoint
and stops.
After 2-3 seconds it crashes on it's own without any manual action like
pressing F8.


I already asked about this question in
http://netbeans.org/bugzilla/show_bug.cgi?id=166379 but it seems this bug
won't be fixed anytime soon.

So we'll have to hold on debugging junit tests using NetBeans.
In eclipse we could do this, but in netbeans why this problem is happening.

--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Forked-Java-VM-exited-abnormally-when-running-junit-tests-seperately-tp4388780p5125333.html
Sent from the Netbeans Project Developers (not for user help) mailing list archive at Nabble.com.
naveenkvm
2012-01-06 12:01:48 UTC
Permalink
If we run the test from command line maven, it passes.
But if we try to debug the test using Netbeans IDE, we get above mentioned
error.

--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Forked-Java-VM-exited-abnormally-when-running-junit-tests-seperately-tp4388780p5125340.html
Sent from the Netbeans Project Developers (not for user help) mailing list archive at Nabble.com.
CerebralVortex
2012-01-24 15:56:04 UTC
Permalink
I ran into this issue today and solved it by looking at the "Output -
PROJECTNAME (test)" windows that is opened when running JUnit....mine showed
I had two versions of ANT one in the netbeans install the other in my local
maven repository. I delete the one in my maven and everything worked again.

Hope this helps.

--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Forked-Java-VM-exited-abnormally-when-running-junit-tests-seperately-tp4388780p5292043.html
Sent from the Netbeans Project Developers (not for user help) mailing list archive at Nabble.com.
gerbenfeenstra
2011-05-12 08:02:17 UTC
Permalink
If I knew how to reproduce this problem I wouldn't be posting here :) I have also no idea if this is really a netbeans problem, it was just a guess.
Can some moderator move this thread to the right forum or should I repost?
Loading...