Bug 35078 - External Tools launch failing
Summary: External Tools launch failing
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 2.1 RC3   Edit
Assignee: Darin Swanson CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
Depends on:
Blocks:
 
Reported: 2003-03-14 17:29 EST by Gerry Reno CLA
Modified: 2003-03-17 14:21 EST (History)
1 user (show)

See Also:


Attachments
log file (2.59 KB, text/plain)
2003-03-14 19:40 EST, Gerry Reno CLA
no flags Details
35078.patch - a patch that fixes the problem (637 bytes, patch)
2003-03-17 10:56 EST, Jared Burns CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gerry Reno CLA 2003-03-14 17:29:00 EST
On a fresh install of Eclipse 2.1 RC2 I setup some of my external tools
definitions but when trying to run some of them I receive a 'Exception occurred
while launching error' and sometimes also a 'Reason: Error within Debug UI'. 
The tools are Linux bash shell commands similar to:

Location: /bin/bash
Working directory: ${project_loc:/WEB-INF/classes}
Arguments: -c "cp -f ${project_name}.jar ../lib"

I had these types of tool definitions working in previous eclipse versions.
Comment 1 Gerry Reno CLA 2003-03-14 17:51:19 EST
One cosmetic comment also.  The order of the elements on External Tools window
is rather annoying.  The order would be more intuitive as:

 Working Directory:
 Location:  <-- this is where the tool is specified
 Arguments: <-- this is where the tools arguments are specified
Comment 2 Gerry Reno CLA 2003-03-14 19:40:19 EST
Created attachment 4159 [details]
log file
Comment 3 Gerry Reno CLA 2003-03-14 19:43:15 EST
all I could see in the log was an old problem with JAVA_HOME not being set
correctly from last week.
Comment 4 Gerry Reno CLA 2003-03-14 21:13:50 EST
This is from Help | About | Configuration Details:
!ENTRY org.eclipse.debug.ui 4 120 Mar 14, 2003 17:05:47.971
!MESSAGE Error logged from Debug UI: 
!STACK 0
java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:277)
	at
org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:351)
	at org.eclipse.debug.ui.DebugUITools.launch(DebugUITools.java:493)
	at org.eclipse.debug.ui.actions.LaunchAction.run(LaunchAction.java:62)
	at org.eclipse.debug.ui.actions.LaunchAction.runWithEvent(LaunchAction.java:77)
	at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:456)
	at
org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:403)
	at
org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:397)
	at
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:72)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:902)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1590)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1383)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1400)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1383)
	at
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
	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:247)
	at org.eclipse.core.launcher.Main.run(Main.java:703)
	at org.eclipse.core.launcher.Main.main(Main.java:539)
Caused by: java.lang.NullPointerException
	at
org.eclipse.ui.externaltools.internal.model.ToolUtil.expandDirectoryLocation(ToolUtil.java:216)
	at
org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil.getWorkingDirectory(ExternalToolsUtil.java:150)
	at
org.eclipse.ui.externaltools.internal.program.launchConfigurations.ProgramLaunchDelegate.launch(ProgramLaunchDelegate.java:63)
	at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:152)
	at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:672)
	at org.eclipse.debug.ui.DebugUITools.buildAndLaunch(DebugUITools.java:537)
	at org.eclipse.debug.ui.DebugUITools$2.run(DebugUITools.java:486)
	at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:95)
Comment 5 Darin Swanson CLA 2003-03-17 10:27:35 EST
Jared can you please investigate.
Comment 6 Jared Burns CLA 2003-03-17 10:53:37 EST
Here's the code in question. Can *you* spot the NPE? :-)

IPath path= null;
try {
  path= variable.getExpander().getPath(varDef.name, varDef.argument, context);
} catch (CoreException exception) {
  status.merge(exception.getStatus());
}
buffer.append(path.toOSString());
Comment 7 Jared Burns CLA 2003-03-17 10:56:02 EST
Created attachment 4175 [details]
35078.patch - a patch that fixes the problem

This NPE would occur anytime we failed to expand a variable in the working
directory.
Comment 8 Darin Wright CLA 2003-03-17 11:03:00 EST
adding EG as CC for RC3 approval.
Comment 9 Erich Gamma CLA 2003-03-17 11:06:22 EST
yes
Comment 10 Jared Burns CLA 2003-03-17 11:18:07 EST
Fixed by returning null when an exception occurs expanding a variable. Please
verify change to ToolUtil, DarinS.
Comment 11 Darin Swanson CLA 2003-03-17 14:21:17 EST
Verified.