This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 33078 - NPE when executing program w/ misconfigured default executor
Summary: NPE when executing program w/ misconfigured default executor
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Execution (show other bugs)
Version: 3.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: REGRESSION
: 32841 33150 34553 (view as bug list)
Depends on:
Blocks: 28340
  Show dependency tree
 
Reported: 2003-04-20 02:16 UTC by johnzoet
Modified: 2008-12-22 19:00 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ide.log (117.96 KB, text/plain)
2003-04-20 02:17 UTC, johnzoet
Details
Patch (1.92 KB, patch)
2003-04-22 16:28 UTC, Jesse Glick
Details | Diff
Binary patch #1 - place in $nbhome/modules/autoload/patches/org-openide-execution/33078-execution.jar (11.75 KB, application/octet-stream)
2003-04-22 16:29 UTC, Jesse Glick
Details
Binary patch #2 - place in $nbhome/modules/autoload/patches/org-openide-debugger/33078-debugger.jar (8.39 KB, application/octet-stream)
2003-04-22 16:30 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description johnzoet 2003-04-20 02:16:28 UTC
First I added a new excutor "External -assert"
which has been set to the project default.
The IDE did not seem to pick this up.
Then I set the External Executor to "User".
Now, whenever I want to execute a program I get a
NullPointerException.
Also, the IDE seems to be stuffed up completely as
I cannot go to options anymore.
ide.log is attached.
Comment 1 johnzoet 2003-04-20 02:17:23 UTC
Created attachment 10045 [details]
ide.log
Comment 2 johnzoet 2003-04-20 02:20:51 UTC
In the mean time I have discovered that the options window was already
open after starting the IDE, but the focus did not go to the options
window.
I have reset the default values of External Execution and system is
working again.
Comment 3 Martin Roskanin 2003-04-22 08:39:58 UTC
Reassigning to openide
Comment 4 Jesse Glick 2003-04-22 16:06:54 UTC
Looks to be regression introduced by fix for issue #28340.
Comment 5 Jesse Glick 2003-04-22 16:28:10 UTC
Not hard to reproduce.

1. Start NB 3.5 beta on a fresh user dir.

2. Open the Options window.

3. Select External Execution. Edit the external process, and change
..../java to some nonsense value, like "foo".

4. Select ImageViewer in sampledir.

5. Press Execute.

NPE is thrown, as described.

I also tried to reproduce with debugger types, since that has similar
code, but did not manage it for some reason.

The problem is that if you have not explicitly selected a service type
for the file, ExecutionSupport.choose is called from startFailed (or
perhaps debugFailed, but I could not reproduced this) with a null arg,
which can sometimes result in an NPE, depending on the exception. Fix
is simple - use the default executor or debugger type in that case.
Comment 6 Jesse Glick 2003-04-22 16:28:34 UTC
Created attachment 10079 [details]
Patch
Comment 7 Jesse Glick 2003-04-22 16:29:32 UTC
Created attachment 10080 [details]
Binary patch #1 - place in $nbhome/modules/autoload/patches/org-openide-execution/33078-execution.jar
Comment 8 Jesse Glick 2003-04-22 16:30:14 UTC
Created attachment 10081 [details]
Binary patch #2 - place in $nbhome/modules/autoload/patches/org-openide-debugger/33078-debugger.jar
Comment 9 Jesse Glick 2003-04-22 17:29:38 UTC
Fixed in the trunk:

Checking in
openide/execution/src/org/openide/loaders/ExecutionSupport.java;
/cvs/openide/execution/src/org/openide/loaders/ExecutionSupport.java,v
 <--  ExecutionSupport.java
new revision: 1.7; previous revision: 1.6
done
Checking in debuggercore/oldapi/src/org/openide/loaders/ExecSupport.java;
/cvs/debuggercore/oldapi/src/org/openide/loaders/ExecSupport.java,v 
<--  ExecSupport.java
new revision: 1.3; previous revision: 1.2
done

QA: please evaluate priority. Could be easily merged to 3.5 if
desired. I am not sure it is worth it. Impact: if a user edits the
default executor (External Execution in the case of .java files, not a
clone of it etc.) so that the external process points to some invalid
path (generally, so that the process cannot even be started), and then
runs a program with no specifically configured executor, the dialog
will display an ugly NPE, rather than saying "The service External
Execution was not appropriate for this object" and opening the dialog
to customize the executor in use or its properties. The detail message
(that the process could not be started) is present in the log file but
not the GUI.
Comment 10 pzajac 2003-04-23 09:51:42 UTC
Jesse, it's perfect. The patch looks fine and cannot cause other
problems. The bug should be merged to release 35. 

Honza,
 can we add the fix to release 3.5 ?
Comment 11 Marian Mirilovic 2003-04-23 10:03:25 UTC
I agree with merging to 3.5, rising priority to P1.
Comment 12 Jesse Glick 2003-04-23 17:22:00 UTC
Checking in
openide/execution/src/org/openide/loaders/ExecutionSupport.java;
/cvs/openide/execution/src/org/openide/loaders/ExecutionSupport.java,v
 <--  ExecutionSupport.java
new revision: 1.6.2.1; previous revision: 1.6
done
Checking in debuggercore/oldapi/src/org/openide/loaders/ExecSupport.java;
/cvs/debuggercore/oldapi/src/org/openide/loaders/ExecSupport.java,v 
<--  ExecSupport.java
new revision: 1.2.12.1; previous revision: 1.2
done
Comment 13 pzajac 2003-04-28 09:36:51 UTC
*** Issue 33150 has been marked as a duplicate of this issue. ***
Comment 14 David Konecny 2003-04-29 09:34:23 UTC
*** Issue 32841 has been marked as a duplicate of this issue. ***
Comment 15 pzajac 2003-05-29 11:01:04 UTC
verified
Comment 16 David Konecny 2003-06-24 13:06:13 UTC
*** Issue 34553 has been marked as a duplicate of this issue. ***