Bug 128605 - [README] Debugger cannot connect to VM when combining IBM and Sun JRE
Summary: [README] Debugger cannot connect to VM when combining IBM and Sun JRE
Status: RESOLVED DUPLICATE of bug 176471
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 critical with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: readme
: 140728 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-02-20 04:27 EST by Dani Megert CLA
Modified: 2007-05-09 16:25 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2006-02-20 04:27:40 EST
3.2 M5

Debugger cannot connect to VM when combining IBM and Sun JRE. Running the application does work.

1. install 3.2 M5
2. start using IBM JRE 5.0 (build pwi32dev-20051104)
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pwi32dev-20051104)
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32 j9vmwi3223-20051103 (JIT enabled)
J9VM - 20051027_03723_lHdSMR
JIT  - 20051027_1437_r8
GC   - 20051020_AA)
JCL  - 20051102

3. install Sun 1.4.2_10
4. create Java project 'P'
5. make sure that project uses 1.4 compiler level and JRE
6. create class Foo with main method
7. start debugger using Sun 1.4.2_10
==> error dialog: Cannot connect to VM + .log entry in dev workspace log:

In Console view:
FATAL ERROR in native method: No transports initialized
Transport dt_socket failed to initialize, rc = 509.

Log in dev workspace log:
!SESSION 2006-02-20 10:17:38.627 -----------------------------------------------
eclipse.buildId=I20060217-1115
java.fullversion=J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32 j9vmwi3223-20051103 (JIT enabled)
J9VM - 20051027_03723_lHdSMR
JIT  - 20051027_1437_r8
GC   - 20051020_AA
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH
Framework arguments:  -update -keyring c:\eclipse\.keyring -application org.eclipse.ui.ide.workbench -showlocation
Command-line arguments:  -update -keyring c:\eclipse\.keyring -application org.eclipse.ui.ide.workbench -showlocation -data c:\eclipse\workspaces\tmp

!ENTRY org.eclipse.jdt.launching 4 120 2006-02-20 10:19:14.925
!MESSAGE Cannot connect to VM
!STACK 0
java.net.SocketException: socket closed
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:423)
	at java.net.ServerSocket.implAccept(ServerSocket.java:462)
	at java.net.ServerSocket.accept(ServerSocket.java:433)
	at org.eclipse.jdi.internal.connect.SocketTransportService.accept(SocketTransportService.java:93)
	at org.eclipse.jdi.internal.connect.SocketTransportImpl.accept(SocketTransportImpl.java:56)
	at org.eclipse.jdi.internal.connect.SocketListeningConnectorImpl.accept(SocketListeningConnectorImpl.java:128)
	at org.eclipse.jdt.internal.launching.StandardVMDebugger$ConnectRunnable.run(StandardVMDebugger.java:78)
	at java.lang.Thread.run(Thread.java:788)
Comment 1 Dani Megert CLA 2006-02-20 04:38:39 EST
Might be a VM bug since it works just fine if I start the dev workspace with:

Sun 1.4:
java version "1.4.2_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_10-b03)
Java HotSpot(TM) Client VM (build 1.4.2_10-b03, mixed mode)

Sun 5.0_06:
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)

IBM 1.4.2:
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM Windows 32 build cn142-20050503 (JIT enabled: jitc))

IBM 1.4.2 J2SC:
IBM J9SE VM (build 2.2, J2RE 1.4.2 IBM J9 2.2 Windows XP x86-32 j9n142-20050430
J9VM - 20050426_1634_lHdSMR
JIT  - r7_level20050420_1807)
Comment 2 Kevin Barnes CLA 2006-02-20 11:39:24 EST
This does appear to be a VM bug. 
The linux version of the same IBM 5.0 VM connects to a Sun target properly.
Marking as WONTFIX.
Comment 3 Dani Megert CLA 2006-02-20 11:43:25 EST
>This does appear to be a VM bug. 
"appears" or "is"?
Comment 4 Kevin Barnes CLA 2006-02-20 16:14:42 EST
Reopening... 
The environment in the target has been changed by something. The bin directory of the 1.5 VM has been tacked on to the beginning of PATH. Editing the path on the Environments tab got it working again for me.

Steps to work around:
Open LCD to the launch config you want to debug on 1.4
Go to Environments Tab
click Select..., then Select All and OK
Find PATH and remove first entry
Select "Replace native environment with specified environment"
Debug.

Still investigating proper fix.
Comment 5 Kevin Barnes CLA 2006-02-23 17:04:03 EST
This is a VM bug. It is the IBM VM that is prepending itself to the path, it is not eclipse.
Comment 6 Darin Wright CLA 2006-05-09 09:39:10 EDT
*** Bug 140728 has been marked as a duplicate of this bug. ***
Comment 7 Sudarsha Wijenayake CLA 2006-05-29 14:34:22 EDT
The same problem is reproducible even when using SUN VM 1.5.
It is not just the IBM VMs causing the problem. 
In this case I was using Eclipse 3.2RC5 with a SUN VM on the SLES platform (SuSE Linux).

Kevin, can you explain exactly what entry that I知 supposed to remove from the PATH string when you said the following

<I>Find PATH and remove first entry</I>
Comment 8 Kevin Barnes CLA 2006-05-29 16:27:56 EDT
This is not reproducible using only Sun VMs because the Sun VM's do not change the PATH environment variable. IBM VM's prepend their bin directory onto the PATH variable and as a result the debugger finds the IBM libraries when it's looking for the Sun libraries.

The workaround is to edit the path on your environment tab so that the libraries associated with the JRE you are using to launch are found first.

Comment 9 Srinivas PSR CLA 2006-06-05 18:29:21 EDT
I am also facing the same issue. But I am trying to use Jboss 3.2.3 & SUN JDK 1.4.6

--PSR
Comment 10 Graham Chapman CLA 2006-06-06 00:55:16 EDT
This is CMVC 103619.  Should be fixed in Java5 SR3.
Comment 11 Darin Wright CLA 2006-06-06 09:29:53 EDT
Srinivas, which JVM are you using to run the Eclipse SDK? Can you attach the stack trace you are seeing? What does the PATH variable look like on the Environment tab of a Java application launch configuration?
Comment 12 Beth Tibbitts CLA 2006-06-09 14:39:36 EDT
I am getting the same problem on Linux. Using IBM JDK 5.0 (May '06) and trying to debug an app with the same JVM.
Eclipse 3.2RC7
IBM Open Client for Linux (RedHat)

I also got Sun's JDK 1.5._0_07
Launched Eclipse with it, and tried to debug an eclipse app, and
i get the same "Cannot connect to VM" error.

Is there any workaround for wanting to run AND debug on 5.0/1.5?
Comment 13 Beth Tibbitts CLA 2006-06-09 15:22:53 EDT
My apologies.  For the launch config, on the Arguments tab,
VM arguments, I had "-vmargs -Xmx512m"  instead of just "-Xmx512m"

Running with Sun's JVM, debugging with same, seems to work now.

Running with IBM's JVM, debugging with same, also works.

Funny that it would manifest itself with same error.
Comment 14 Beat Schaller CLA 2006-09-29 07:32:42 EDT
(In reply to comment #13)
> My apologies.  For the launch config, on the Arguments tab,
> VM arguments, I had "-vmargs -Xmx512m"  instead of just "-Xmx512m"
> 
> Running with Sun's JVM, debugging with same, seems to work now.
> 
> Running with IBM's JVM, debugging with same, also works.
> 
> Funny that it would manifest itself with same error.
> 

I had the same problem using two different version of Java.
I am using Eclipse 3.2.
When I start the IDE with Java jre1.5.0_06 and I use internally in my project the version j2sdk1.4.2_07 I get this error. When I convert the project to the 1.5 version it works.
Starting the IDE with 1.4 and debugging with the same version works. Don't know if it is an eclipse bug or a VM bug.
Comment 15 Darin Wright CLA 2006-09-29 09:47:27 EDT
You should be able to run the SDK and debug programs on different VMs.
Comment 16 Darin Wright CLA 2007-05-09 16:25:04 EDT
This has been fixed in 3.3, by bug 176471.
Comment 17 Darin Wright CLA 2007-05-09 16:25:26 EDT

*** This bug has been marked as a duplicate of bug 176471 ***