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.
Summary: | Use extexecution in JavaRunner (old Ant in dep => JUnit failure) | ||
---|---|---|---|
Product: | java | Reporter: | Masaki Katakai <masaki> |
Component: | Project | Assignee: | Tomas Zezula <tzezula> |
Status: | REOPENED --- | ||
Severity: | blocker | CC: | converginglight, jglick, johan.sehlstedt, mjanicek, mkleint, mmirilovic, naveenkvm, t_h |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 205359, 206783 | ||
Bug Blocks: | 145980, 232370 | ||
Attachments: | Project that reproduce the error |
Description
Masaki Katakai
2009-06-02 06:56:50 UTC
sample project mvntestsample.zip http://ja.netbeans.org/servlets/GetAttachment?list=netcat67&msgId=2038623&attachId=1 the problem is primary in the CompileOnSave/Quick runner API/implementation which is backed by ant execution, the Maven support just feeds the project classpath to it. reassigning. We might filter out ant from classpath, but I consider that suboptimal (as the project might still fail but in more subtle ways.. A possible workaround for maven projects is to disable the Compile On Save feature for test execution. Alternatively setting the IDE's ant version to 1.5.x could also help. The proper fix is to not use Ant scripts to implement JavaRunner to begin with. This was promised for a post-6.5 release but apparently it was neglected for 6.7. We now have extexecution and this should be used. *** Issue 166856 has been marked as a duplicate of this issue. *** *** Issue 166879 has been marked as a duplicate of this issue. *** If we use extexecution from JavaRunner, especially if that can create a pty on Unix, we could consider deleting ForkedJavaOverride in the Ant module. Then if you use CoS your program would behave very much like it would from 'java clazz.Name' on the CLI (Ant would not be involved); if not, you would get standard Ant "cooked" (buffered) I/O. I don't know about "older ant dependencies", but with Netbeans 6.9.1 and built-in Ant (1.8.1) it is very simple to reproduce that bug: import org.junit.*; public class _JUnitVMError { @Test public void test1() throws Exception { System.exit(0); } } Should I file a new bug for that, or is it the same? It is especially annoying because one can't use JUnit to test "JFrame"s which have EXIT_ON_CLOSE property (they seem to make use of System.exit). The output of above code is: Testcase: _JUnitVMError:test1: 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) (In reply to comment #7) > one can't use JUnit to test "JFrame"s which > have EXIT_ON_CLOSE property (they seem to make use of System.exit) Quite true. So if you want to test that JFrame directly (rather than e.g. some interior JPanel), fix it to not use EXIT_ON_CLOSE. This is just a basic testability refactoring. > Testcase: _JUnitVMError:test1: Caused an ERROR > Forked Java VM exited abnormally. This is correct. JUnit tests which exit the VM before the test runner completes normally are presumed to have crashed it. This is long overdue. If you do not plan to work on it, assign it to me. (In reply to comment #9) > This is long overdue. If you do not plan to work on it, assign it to me. Hi, We are using NetBeans 7.1 RC2 and we are still getting this error. Was this bug fixed in 7.1 RC2? Or still open for all versions of NetBeans? 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. (In reply to comment #9) > This is long overdue. If you do not plan to work on it, assign it to me. Hi, We are using NetBeans 7.1 RC2 and we are still getting this error. Was this bug fixed in 7.1 RC2? Or still open for all versions of NetBeans? 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. (In reply to comment #11) > (In reply to comment #9) > > This is long overdue. If you do not plan to work on it, assign it to me. > > Hi, > > We are using NetBeans 7.1 RC2 and we are still getting this error. > Was this bug fixed in 7.1 RC2? Or still open for all versions of NetBeans? > > 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. 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. (In reply to comment #10) > Was this bug fixed in 7.1 RC2? Or still open for all versions of NetBeans? It is still open. And please do not touch the Version field, as this represents the oldest version for which the bug was reported. > Forked Java VM exited abnormally. Typically that would be a bug in the VM, not the IDE, and is probably unrelated to this bug. If you can reproduce your problem from scratch, file a separate bug report. (In reply to comment #13) > (In reply to comment #10) > > Was this bug fixed in 7.1 RC2? Or still open for all versions of NetBeans? > > It is still open. And please do not touch the Version field, as this represents > the oldest version for which the bug was reported. > > > Forked Java VM exited abnormally. > > Typically that would be a bug in the VM, not the IDE, and is probably unrelated > to this bug. If you can reproduce your problem from scratch, file a separate > bug report. But that error is happening only if i run the Netbeans IDE in debug mode by selecting 'Debug Test File'. If i do 'Test file', it passes. Why this error happens only in debug mode if it is VM problem? (In reply to comment #3) > The proper fix is to not use Ant scripts to implement JavaRunner to begin with. > This was promised for a post-6.5 release > but apparently it was neglected for 6.7. We now have extexecution and this > should be used. ->P2 *** Bug 216586 has been marked as a duplicate of this bug. *** Created attachment 125131 [details]
Project that reproduce the error
For Bug 216586 (marked as duplicate of this bug). One way to bypass the problem is to add the following line in the build.xml. <property name="run.jvmargs.ide" value=""/> Thanks for the workaround..... It worked for me in 7.2 I hope for a fix in 7.3 After discussion with Milos Kleint: The maven CoS support will be reimplemented to execute maven just to bypass compile step, so this issue become useless. The JavaRunner is just support API which will be used just by Ant project. Already fixed in maven support. The maven CoS support is reimplemented to execute maven just to bypass compile step, so this issue is now useless. Consider comment #6, which has nothing to do with Maven; the current JavaRunner is bad for Ant-based projects too. Based on comment #6 it still makes a sense to rewrite the JR to use ExternalProcessBuilder. |