Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 158807 - VM error while debugging on resume
Summary: VM error while debugging on resume
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 163129 195475 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-26 13:00 EDT by Olivier Thomann CLA
Modified: 2007-07-16 11:16 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2006-09-26 13:00:30 EDT
When I debug code, sometimes on resume, I get this error in the console.

ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):  [../../../src/share/back/util.c:820]

I don't have reliable steps to reproduce.
Comment 1 Michael Rennie CLA 2007-01-26 12:30:59 EST
*** Bug 163129 has been marked as a duplicate of this bug. ***
Comment 2 Darin Wright CLA 2007-02-08 14:41:12 EST
Olivier, have you seen this problem in 3.3 lately? Without steps to reproduce there is nothing we can do.
Comment 3 Olivier Thomann CLA 2007-02-08 14:49:31 EST
I didn't get it lately, but when I got it it was repeatable.
Ok to close for now and I'll reopen if I get it again.
Comment 4 Darin Wright CLA 2007-02-08 14:51:28 EST
Thanks, marking as works for me.
Comment 5 Missing name Mising name CLA 2007-05-13 10:30:59 EDT
Just seen in 3.3M7, fresh workspace.  Try this:

public class Pqr {
	public static void main(String[] args) {
		new Vwx(5).doSomething(5);
	}
}

public class Stu {
	public Stu(int x) {
		x++;
	}

	public void doSomething(int x) {
		x++;  // breakpoint
	}
}

1. Use the two source files above and set the breakpoint as shown.
2. Launch Pqr in debug mode.
3. When the breakpoint is hit rename class Stu to Vwx.
4. The new hot code replace dialogue appears - choose Restart.
5. Breakpoint hits again.  Resume execution.

(During this I manually accept firewall alerts for the VMs to make/accept local connections).

About one in four attempts results in the following:

ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):  [../../../src/share/back/util.c:820]

It seems slightly more likely to occur if you pause a few seconds between each step.

Eclipse and runtime VM info:

java.version=1.6.0
java.vm.info=mixed mode
java.vm.name=Java HotSpot(TM) Client VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Sun Microsystems Inc.
java.vm.specification.version=1.0
java.vm.vendor=Sun Microsystems Inc.
java.vm.version=1.6.0-b105

(which I know isn't an officially supported target VM)

Project compiler, class and source are in 6.0 mode.
Comment 6 Missing name Mising name CLA 2007-05-13 11:10:36 EDT
Also seeing in:
 - Compiler compliance 5.0, runtime JVM Sun 1.6.0-b105 (Win XP)

Not yet seen in:
 - Compiler compliance 5.0, runtime JVM Sun 1.5.0.08
 - Compiler compliance 5.0, runtime JVM jrockit-R26.4.0-jre1.5.0_06 (although this leaves open an editor corresponding to the renamed source file, which causes problems if attempting to rename back).

Seems to be a Sun 1.6 JVM bug. 
See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6476706
Comment 7 Darin Wright CLA 2007-07-16 11:16:06 EDT
*** Bug 195475 has been marked as a duplicate of this bug. ***