Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 106683

Summary: org.eclipse.jdt.launching.j9 contribution
Product: [Eclipse Project] JDT Reporter: fernando concha <fconcha>
Component: DebugAssignee: Darin Wright <darin.eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: berthold_lebert, chris.senior, khorowit, loats, mhoff, robbinsj, tjwatson
Version: 3.0.1   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
org.eclipse.jdt.launching.j9 patch
none
patch of WSDD's and eclipse.or HEADs
none
updated to work with the HEAD
none
Problem applying the patch
none
New patch none

Description fernando concha CLA 2005-08-10 15:45:55 EDT
the following patch is the contribution of org.eclipse.jdt.launching.j9 from 
WSDD.
Comment 1 fernando concha CLA 2005-08-10 15:47:03 EDT
Created attachment 25992 [details]
org.eclipse.jdt.launching.j9 patch
Comment 2 Olivier Thomann CLA 2005-08-10 16:47:41 EDT
Move to JDT/Debug
Comment 3 Darin Wright CLA 2005-08-12 10:37:10 EDT
Fernando, when I attempt to apply this patch, I get conflicts with what is in 
HEAD (for example, . Could you please regenerate the patch against the 
contents of HEAD so that 'Team > Apply Patch' works without conflicts. 

As well, I get two compilation errors when I apply the patch as is. 
DebugCoreMessage is an internal class in the org.eclipse.debug.core plug-in 
and should not be used by other plugins.

The method getString(String) is undefined for the type DebugCoreMessages
	J9VMRunner.java
	org.eclipse.jdt.launching.j9/j9/org/eclipse/jdt/internal/launching/j9
	line 406	August 12, 2005 9:34:21 AM
The method getString(String) is undefined for the type DebugCoreMessages
	J9VMRunner.java
	org.eclipse.jdt.launching.j9/j9/org/eclipse/jdt/internal/launching/j9
	line 416	August 12, 2005 9:34:21 AM
Comment 4 fernando concha CLA 2005-08-15 17:26:46 EDT
Created attachment 26133 [details]
patch of WSDD's and eclipse.or HEADs
Comment 5 fernando concha CLA 2005-08-15 17:30:16 EDT
I disconnected from my CVS repo and connected to the org.eclipse HEAD then 
generated the patch.  The problem could be that our project is not based on 
the eclipse HEAD but in an ealier (years ago) version of the project.  
Applying this patch will probably delete code that was added since the version 
we used for base.
Comment 6 Darin Wright CLA 2005-08-30 11:31:24 EDT
I think you will need to load all the latest debug plug-ins from HEAD to 
generate the patch. When I apply the patch as is to HEAd, I get the following 
compilation error:

Severity	Description	Resource	In Folder	Location
	Creation Time	Id
2	The method getString(String) is undefined for the type 
DebugCoreMessages	J9VMRunner.java
	org.eclipse.jdt.launching.j9/j9/org/eclipse/jdt/internal/launching/j9
	line 406	August 30, 2005 10:25:27 AM	34863
Comment 7 fernando concha CLA 2005-09-02 15:29:48 EDT
Created attachment 26810 [details]
updated to work with the HEAD

 updated the class to work with the debug plug-in that is in the head
Comment 8 Jim Robbins CLA 2005-09-20 13:44:46 EDT
Any progress on this?
Comment 9 Darin Wright CLA 2005-09-23 09:35:31 EDT
Created attachment 27435 [details]
Problem applying the patch

The patch does not apply cleanly for me. When I attempt to apply the patch I
get conflicts in the following files that show as "file already exists" (I will
attach a screen shot). I have not compared all files to see if there actually
any changes (hopefully the tool would do that for me :-)
Comment 10 fernando concha CLA 2005-09-30 15:00:50 EDT
Created attachment 27731 [details]
New patch

OK Darin,  tried this 1)downloaded the pl;ug-in from the Eclipse repository  2)
compared and updated all existing files, over wrote the older existing files 3)
Added all new files and created the patch.  I can see the differences in the
patch file
Comment 11 Darin Wright CLA 2005-10-05 09:15:36 EDT
The will apply clean now. Code will take some time to review.
Comment 12 Tobias Rho CLA 2005-10-17 10:31:26 EDT
Your latest patch leads to a NullPointerException in my configuration
(Eclipse 3.2M2).

I fixed this by changing J9Launching.java:527

from

if (config.getBootClassPath().length == 0) {

to

if (config.getBootClassPath() == null || config.getBootClassPath().length == 0) {


=====================================================

java.lang.NullPointerException
	at
org.eclipse.jdt.launching.j9.J9Launching.adaptVMRunnerConfiguration(J9Launching.java:527)
	at org.eclipse.jdt.internal.launching.j9.J9VMRunner.run(J9VMRunner.java:167)
	at
org.knopflerfish.eclipse.core.launcher.OsgiLaunchDelegate.launch(OsgiLaunchDelegate.java:174)
	at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:590)
	at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:515)
	at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:733)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlugin.java:931)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Comment 13 Berthold Lebert CLA 2005-11-02 17:59:41 EST
With this patch, running a simple HelloWorld application with J9 2.2 and 2.3 
works. Debugging J9 2.2 works, too. But debugging J9 2.3 doesn't:

  \ive\bin\j9w.exe -classpath C:\eclipse\workbench\Test
   -Xrdbginfo:9.72.69.57:3715
   -Xrunjdwp:address=9.72.69.57:3716,transport=dt_socket -Xdebug
   -jcl:foun10 Hello

with this error:

 UTE405: can't add duplicate j9dbgtspt component to traceable component list
 UTE051: Module not configured for trace: j9dbgtspt
 could not connect to debug info server at 9.72.69.57:3712
 JVMJ9VM015W Initialization error for library j9rdbi23(11): failed to connect
 to debug info server
 JVMEXEX013E Internal VM error: Failed to create Java VM
 JVMEXEX014I Run \ive\bin\j9w.exe -help for usage

and for:  \ive\bin\j9dbgserv -J-Dconsole.encoding=Cp1252 -port:3715

-> unkown option -j-dconsole.encoding=cp1252

Removing this line in J9ListeningConnector:

  list.add("-J-Dconsole.encoding=" + System.getProperty("file.encoding"));

doesn't help much:


j9dbgserv version 2005/05/18
(c) Copyright IBM Corp. 2000,2004 All Rights Reserved
US Government Users Restricted Rights - Use, duplication or disclosure
restricted by GSA ADP Schedule Contract with IBM Corp.

usage: j9dbgserv [-nologo] -port:<portnumber> -symfiles:<symfile path>
nologo: do not display the copyright information
portnumber: the port where the server listens for a VM
	The default is 8888
symfile path: A list of paths (directories or files) of symbol
	files to load, separated by the system path separator
	Example: c:\symfiles;c:\test\HelloWorld.sym

Server socket successfully started on port 3742
Socket connection accepted on port 40974
Error handling requests
Socket Error
Comment 14 Jim Robbins CLA 2005-11-08 12:08:23 EST
Is it possible to get this fix committed since it works on J9 2.2 and launching 
with 2.3?  we can fix debug for 2.3 later.   
Comment 15 Darin Wright CLA 2005-11-08 14:23:59 EST
The patch needs to be reviewed by committers before it can be applied. Since 
the patch is of a significant size, the review will take some time (it could 
take a few weeks in order to free up the resources to review it).
Comment 16 Thomas Watson CLA 2005-11-17 10:02:00 EST
A workaround for debugging J9 2.3 is to add -debug:server=y to the VM args and 
launch J9 normally (using the normal Java Application, Eclipse Application 
etc. launchers).  Then you can use the Remote java Application launcher to 
connect to J9.
Comment 17 Darin Wright CLA 2005-12-06 17:07:37 EST
Applied patch. The plug-in was versioned as v20051206 prior to release to HEAD for those that want to fallback. This will be the new starting point for the j9 launching plug-in.
Comment 18 Darin Wright CLA 2005-12-06 17:08:21 EST
Verified.
Comment 19 Darin Wright CLA 2006-01-04 15:04:17 EST
*** Bug 115175 has been marked as a duplicate of this bug. ***
Comment 20 Phil Loats CLA 2006-03-28 09:50:48 EST
Is there any progress on launching debug sessions with j9 2.3?  J9 2.3 will be going to customers soon and the workaround leaves a less-than-ideal impression for customers of j9.
Comment 21 Darin Wright CLA 2006-03-28 09:54:48 EST
There are no special plug-ins in the SDK for J9 launching - it works with standard command line options with the standard VM launcher. The j9 launching plug-in in the repository can be used for launching J9, but it is not part of the SDK.
Comment 22 Phil Loats CLA 2006-03-28 16:11:33 EST
The problem I referenced here is that debug sessions can only be launched IF jclFoundation10 profile exists.  I will open a new defect for this problem.
Comment 23 Tobias Rho CLA 2006-08-03 10:29:13 EDT
I found another bug on the Windows platform (Eclipse 3.2):

The line J9VMRunner.java:625:
program.append("j9w.exe"); //$NON-NLS-1$
must be changed to
program.append("j9.exe"); //$NON-NLS-1$

Otherwise the j9version will always be 2.2 (the default value)
This lead to bug mentioned by Berthold Lebert in https://bugs.eclipse.org/bugs/show_bug.cgi?id=106683#c13.

Debugging regular Java application now works fine.
BUT I am still not able to debug JUnit sessions. 
The system hangs after j9dbgserv was started. 

And, if I add an break point I get the following error message:
"Unable to install breakpoint in pckg.Test due to missing line number attributes. Modify compiler options to generate line number attributes."