Community
Participate
Working Groups
create a JSP server and invoke RoS from the editor' s context menu. It fails with did not find anything to deploy to server. RoS works for the same file if invoked from the context menu in Project Explorer.
*** Bug 116534 has been marked as a duplicate of this bug. ***
I tracked down the problem and it is caused by a bad input to the server tools launch shortcut (org.eclipse.wst.server.ui.internal.ServerLaunchShortcut). This class has two methods that are called by the Eclipse debug framework when the user selects RoS. I've found the following behaviour: * When the user does RoS directly on a file, my launch shortcut's launch(ISelection,String) method gets called with the File as a selection. * When using the Java editor, Text editor, or other editors, the launch(IEditorPart,String) method gets called instead, and I can get the file if the editor input happens to be IFileEditorInput. Things still work. * When using our HTML/JSP editor, the launch(ISelection,String) method gets called with the current textual selection... causing things to fail since the selection doesn't give me any way of finding out what the user wants to run. David - Since this problem only occurs within the WTP editors, I'm planning to transfer this bug across after I've finished checking the rest of the editors. Do you have any idea why our editors would be behaving this way? It almost looks like there is a special selection provider that is interferring with the Debug framework.
Here are the steps to reproduce in WTP: * Import org.eclipse.wst.server.ui with source in your development environment. * Open org.eclipse.wst.server.ui.internal.ServerLaunchShortcut and set a breakpoint in both of the launch() methods. * Launch a runtime workspace. * Create a Web project. * Create a JSP file in the Web project. * Open the JSP editor. * Right click and pick Run > Run on Server. The launch(ISelection,String) method is called and the breakpoint is hit. Resume execution and the failure occurs. * Close the editor and open the JSP file with a text editor. * Right click and pick Run > Run on Server. The launch(IEditorPart,String) method is called and the breakpoint is hit. Resume execution and the regular Run on Server dialog appears. I found the underlying problem. In org.eclipse.debug.internal.ui.actions.LaunchShortcutAction, the run() method first looks for a structured selection in the current workbench page and uses the current editor as a backup. When any of the SSE editors are active, they supply a structured text selection (even if nothing is selected), basically breaking the debug assumption. Passing to SSE first since I have only seen this behaviour with SSE editors. If the SSE editors don't need to (or shouldn't) be providing a structured selection, then the fix is to change the selection. If this is a bad assumption and SSE is doing everything right, then please pass this on to the Platform Debug team.
It looks like it's a bad assumption to me; the SSE editors need to provide an IStructuredSelection to connected views and actions. The LaunchShortcutAction might want to consider if the active part is an editor part, then check the selection, and then just use the active editor part as a fallback.
Fixed in 3.2 and 3.1.2 streams
Please verify, Michael. The fix is as suggested - if the active part is an editor, send the launch(IEditorPart, mode) message to the shortcut instead of the structured selection.
verified, if the selection is an EditorPart (editor) then the launch(IEditorPart, mode) is in fact used. When a launch is initiated its context is tested to see if it is an EditorPart or a selection, prior to either of the launch calls occuring.