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

Bug 74431

Summary: [Mac] runtime discovers JDI interfaces in classes.jar before jdi.jar
Product: [Eclipse Project] Platform Reporter: Kevin Barnes <cocoakevin>
Component: DebugAssignee: Kevin Barnes <cocoakevin>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: andre_weinand
Version: 3.0   
Target Milestone: 3.1 M2   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Kevin Barnes CLA 2004-09-21 11:11:12 EDT
Any inspect causes the following error in my log. (The variables view works fine)

Error Sep 21, 2004 09:52:04.993 com.sun.jdi.LocalVariable.genericSignature()Ljava/lang/String;
java.lang.NoSuchMethodError: com.sun.jdi.LocalVariable.genericSignature()Ljava/lang/String;
at org.eclipse.jdt.internal.debug.core.model.JDILocalVariable.getGenericSignature(JDILocalVariable.java:
124)
at 
org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.getCompiledExpression(ASTEvaluati
onEngine.java:149)
at 
org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.evaluate(ASTEvaluationEngine.java:
76)
at org.eclipse.jdt.internal.debug.ui.actions.EvaluateAction.run(EvaluateAction.java:240)
at org.eclipse.jdt.internal.debug.ui.actions.InspectAction.run(InspectAction.java:87)
at org.eclipse.jdt.internal.debug.ui.actions.EvaluateAction.run(EvaluateAction.java:561)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:298)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:221)
at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:188)
at org.eclipse.ui.internal.commands.Command.execute(Command.java:130)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:463)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:956)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:997)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:
541)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2(WorkbenchKeyboard.java:488)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent(WorkbenchKeyboard.java:241)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:925)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1195)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1220)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1205)
at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:1995)
at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:1990)
at org.eclipse.swt.widgets.Control.kEventTextInputUnicodeForKeyEvent(Control.java:1499)
at org.eclipse.swt.widgets.Composite.kEventTextInputUnicodeForKeyEvent(Composite.java:392)
at org.eclipse.swt.widgets.Widget.textInputProc(Widget.java:1607)
at org.eclipse.swt.widgets.Display.textInputProc(Display.java:3322)
at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native Method)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2530)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1443)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1414)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:271)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:704)
at org.eclipse.core.launcher.Main.main(Main.java:688)
Comment 1 Kevin Barnes CLA 2004-09-21 11:27:34 EDT
Display causes the same error, but Debug Hovers work.
Comment 2 Darin Wright CLA 2004-09-21 12:10:31 EDT
On the Mac, classes.jar contains the com.sun.jdi interfaces. Since classes.jar 
is on the bootpath (by default), the 1.4 implementation of the JDI interfaces 
is found before ours (in org.eclispe.jdt.debug). The 1.4 implementation of the 
JDI interfaces does not contain the method #gernericSignature().

On other platforms, the com.sun.jdi.* packages are in tools.jar which is not 
on the bootpath/classpath. Not sure why they are packaged this way on the Mac.
Comment 3 Darin Wright CLA 2004-09-21 12:39:31 EDT
By prepending org.eclipse.jdt.debug_n_n_n/jdi.jar to the boot classpath, this 
problem can be avoided. It requires adding an entry in the "info.plist" file 
like "-Xbootclasspath/p:plugins/org.eclipse.jdt.debug_3_1_0/jdi.jar".

Andre, dan we extend this to target IDE's for self hosting? i.e. without 
explicitly adding a boot classpath argument to the launch config?
Comment 4 Andre Weinand CLA 2004-09-21 12:52:14 EDT
Yes, I hope so.
Luckily we have the o.e.jdt.launching.macosx plugin whose sole purpose in live is to pass a 
-DStartOnFirstThread argument to any SWT application.
I'm sure that I can pass a -Xbootclasspath/p:plugins/org.eclipse.jdt.debug_3_1_0/jdi.jar" as well.
Do I have to hardcode this argument or is there a place where I can get it from?
Comment 5 Darin Wright CLA 2004-09-21 12:59:02 EDT
It will have to be dynamic, since the classes may exist as a required plug-in 
or as classes in the output (bin) directory of the plug-in as it is developed.

For M2, the simple story may be best - i.e. just make things work in the SDK 
by providing the correct info.plist.
Comment 6 Andre Weinand CLA 2004-09-21 13:29:16 EDT
Darin, did you try the "-Xbootclasspath/p:plugins/org.eclipse.jdt.debug_3_1_0/jdi.jar" in the Info.plist?
If not, how can I verify that is works?
Comment 7 Kevin Barnes CLA 2004-09-21 13:37:25 EDT
I have edited my info.plist file and verified that the fix works in my host (ie Inspect and Display are 
working again).
I also tried adding Xbootclasspath/p:... to the VM arguments of my runtime workbench launch config, 
but haven't had any luck fixing the problem in my target yet.
Comment 8 Kevin Barnes CLA 2004-09-21 13:47:17 EDT
Just a clarification.... The VM Argument should be "-Xbootclasspath/p:plugins/
org.eclipse.jdt.debug_3.1.0/jdi.jar". Previous comments had "...3_1_0/jdi.jar".
Comment 9 Andre Weinand CLA 2004-09-21 13:58:53 EDT
added 
	<string>-Xbootclasspath/p:plugins/org.eclipse.jdt.debug_3.1.0/jdi.jar</string>
to Info.plist and released for M2.
Comment 10 Darin Wright CLA 2004-09-21 14:05:54 EDT
Marking as fixed. Will need to be verified in a later build.
Comment 11 Darin Wright CLA 2004-09-21 14:06:08 EDT
... by Kevin.
Comment 12 Kevin Barnes CLA 2004-09-23 12:37:14 EDT
verified