This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 215153 - Forked Java VM exited abnormally when Ant Testing an EJB module
Summary: Forked Java VM exited abnormally when Ant Testing an EJB module
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P3 normal with 3 votes (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-04 04:38 UTC by nabuage
Modified: 2013-11-27 10:47 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Output of the failing test. Ant verbose mode set to 'verbose' (52.37 KB, text/plain)
2012-09-24 16:15 UTC, lucabur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nabuage 2012-07-04 04:38:07 UTC
Product Version = NetBeans IDE 7.2 RC1 (Build 201206272359)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_05
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.1-b03
----------------------
When I run test (ALT+F6) on an EJB Module,  it is failing: "caused an ERROR: Forked Java VM exited abnormally.  Please note the time in the report does not reflect the time until VM exit."

This error only happens if there is an Entity class (with Persistence.xml) and a Session Bean inside the EJB module and test file is using the EJBContainer.

Below is the output during the test:

ant -f C:\\Users\\Username\\Documents\\NetBeansProjects\\EJBModule1 -Dignore.failing.tests=true -Dnb.wait.for.caches=true test
init:
deps-jar:
compile:
compile-test:
Error: Could not find or load main class ${run.jvmargs.ide}
Testsuite: ejb.NewSessionBeanTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

Testcase: ejb.NewSessionBeanTest: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:153)


Test ejb.NewSessionBeanTest FAILED (crashed)
test-report:
test:
BUILD SUCCESSFUL (total time: 1 second)
Comment 1 andressdl 2012-09-14 16:37:17 UTC
I had this problem with 7.2 also. At first I edited build-impl.xml, changing all the junit tasks to 'fork="false"'. While this worked, it would also reset to true whenever I changed project properties. 

One of the errors in the output window mentioned not finding JUnit annotations. After reading further through build-impl.xml I found some conditions looking for junit+testng. On a whim I added TestNG to Libraries>Test Compile.  Problem solved.
Comment 2 nabuage 2012-09-14 21:17:20 UTC
I can confirm that adding the TestNG library to the Test Libraries fixed the issue.
Comment 3 lucabur 2012-09-24 15:56:08 UTC
I got the same error with NB 7.2.
Adding the TestNG library doesn't work in this case because the test is part of a Spring based project where all the test suite is built around the Spring + JUnit-4.4 framework and including the TestNG introduces new errors.

Please consider raising the priority to the higher value. Development activities on all our Spring based EJB projects are virtually stopped by several randomly scattered tests failing !

Providing a testcase is very complex and I will try to do this only if really needed. Pleas let me know how I can help.
This is the (not very useful !) output of the test run:
---
Errore: impossibile trovare o caricare la classe principale ${run.jvmargs.ide}
(N.B.: this is the italian version of the error "Could not find or load main class ${run.jvmargs.ide})
Testsuite: it.mate.iside.model.JpaPuTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

Testcase: it.mate.iside.model.JpaPuTest: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:153)


Test it.mate.iside.model.JpaPuTest FAILED (crashed)
Comment 4 lucabur 2012-09-24 16:15:21 UTC
Created attachment 124818 [details]
Output of the failing test. Ant verbose mode set to 'verbose'
Comment 5 lucabur 2012-10-02 12:58:12 UTC
I am not sure but this bug is someway related to the bugs 216586 and 166379.
The suggestion given by Johan here: http://netbeans.org/bugzilla/show_bug.cgi?id=166379#c18 works !
( Define the property <property name="run.jvmargs.ide" value=""/> in the file build.xml )
Comment 6 Theofanis Oikonomou 2012-11-15 15:23:32 UTC
If this is the case then it was solved by: http://hg.netbeans.org/main-silver/rev/df77a63521e7

Please try with the latest build and reopen if this is not fixed. Thank you