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 24585 - NPE in JavaDataObject.files
Summary: NPE in JavaDataObject.files
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
: 24597 24829 24936 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-06-10 12:17 UTC by gthb
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ide.log showing the NPE I'm reporting (12.40 KB, text/plain)
2002-06-10 12:18 UTC, gthb
Details
Yet another ide.log, showing the NPE despite no ant compiler (93.75 KB, text/plain)
2002-06-10 15:40 UTC, gthb
Details
Exception appears if and only if this .nbattrs file is encountered (3.29 KB, text/plain)
2002-06-10 15:49 UTC, gthb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gthb 2002-06-10 12:17:54 UTC
After a bumpy start with the 3.4 Beta-1 build, I
get a NullPointerException on every startup, at
at org.netbeans.modules.java.JavaDataObject.files
(JavaDataObject.java:212) when called from
org.openide.loaders.DataNode.getDisplayName
(DataNode.java:153)

It's an improvement from the 58 exceptions in my first
Beta-1 startup! :)

Will attach the whole ide.log giving the full stack trace.
Comment 1 gthb 2002-06-10 12:18:51 UTC
Created attachment 6170 [details]
ide.log showing the NPE I'm reporting
Comment 2 gthb 2002-06-10 12:23:35 UTC
Oh. It got lots worse. As soon as I opened a filesystem
in my project, containing code -- I got the same exception.
Repeatedly. In an infinite loop. I tried Alt-F4 to kill the
ide, but that didn't get me out of the infinite loop. In
the Windows Task Manager, I ended the process. Didn't work
the first time (still infinite loop), but the IDE died the
second time I tried it.
Comment 3 gthb 2002-06-10 12:38:55 UTC
I tried switching to another project (project B) that I
hadn't touched since before I upgraded [hm :)] to Beta-1.
Got the same exception during the project switch, but no
infinite loop. Switched to project C and got no exception,
and was able to browse the .java nodes in the explorer
filesystems tab, no problems. Switched back to project B
and got the exception, but was able to browse the .java
nodes and didn't end up in an infinite loop. Then switched
back to project A and got the exception, and the filesystems
tab was removed from Explorer! When I reopened Explorer
using View -> Explorer, the filesystems tab reappeared --
along with the exception dialog, same exception.

I can't think of any significant difference between the
projects that would explain the different manifestations of
this exception -- they all follow the standard form of
projects at my company (several filesystems with source
files, several mounted jars, and a couple of directories
with XML documentation files).

A possibly significant sidenote: I had installed RefactorIT
beta (0.9.2) as a Netbeans module in my Q-build installation
prior to installing the Beta-1 build. When I installed the
Beta-1 build, I first ran the uninstaller for RefactorIT,
then renamed my c:\netbeans directory, then unzipped the
Beta-1 .zip file in its place, then started up. On the
first startup, I got 58 exceptions (counting only the
top-level ones reported in a dialog, not the wrapped ones),
including this one. The full ide.log from that first startup
is at http://www.hi.is/~gthb/nb-issues/ide.log (too large
to attach, I thought), and I first described that mess on
issue #24178.
Comment 4 gthb 2002-06-10 12:45:30 UTC
Minor detail, in case it helps: in the infinite loop, each
appearance of the dialog has a Next button, which displays
the exact same stack trace (confirmed by diff). There are
only these two stack traces (i.e. there isn't a second
Next), but when I Alt-Tab out of the window to type into
this issue form and then Alt-Tab back into Netbeans, a
third stack trace (also identical) has appeared in the
dialog (so the dialog initially has a Next button, when
I click it it has a Previous and a Next button, and when
I click Next again, it has only a Previous button -- the
stack trace is the same in all cases).

And when I click OK, I get the dialog directly again, hence
the infinite loop.
Comment 5 Tomas Hurka 2002-06-10 12:47:10 UTC
Fixed in trunk. 
Comment 6 Tomas Hurka 2002-06-10 12:50:50 UTC
This problems occurs if you have 'Ant Indirect Compilation' or 'Ant
Script Compilation' as default compiler for Java Sources. 
Comment 7 gthb 2002-06-10 12:54:19 UTC
Thanks, that provides an OK workaround so that I
don't have to backtrack to the last Q-build before
Beta-1 (which I was about to do :)
Comment 8 gthb 2002-06-10 15:36:09 UTC
Nope, sorry. I switched my default compiler to external,
and didn't get it for a while, but now got it again, while
browsing in the explorer in a filesystem containing .java
source nodes. I will attach the ide.log ...
Comment 9 Jan Becicka 2002-06-10 15:39:09 UTC
*** Issue 24597 has been marked as a duplicate of this issue. ***
Comment 10 gthb 2002-06-10 15:40:08 UTC
Created attachment 6178 [details]
Yet another ide.log, showing the NPE despite no ant compiler
Comment 11 gthb 2002-06-10 15:48:21 UTC
I narrowed it down a bit: I tried deleting .nbattrs from
the directory I had just opened in Explorer when the
exception occurred, and starting Netbeans. The exception
did not appear, everything was fine. I shut down Netbeans,
restored the .nbattrs file in that directory, started up
Netbeans again, and sure enough, the exception came up
again. I'll attach the .nbattrs file here.
Comment 12 gthb 2002-06-10 15:49:28 UTC
Created attachment 6179 [details]
Exception appears if and only if this .nbattrs file is encountered
Comment 13 gthb 2002-06-10 15:52:40 UTC
Oh, and in that .nbattrs file there is an <attr> element
with name="NetBeansAttrDataObjectCompilerManager" ...
which sounds like this object was overriding the default
compiler setting of the project and IDE, reinstating the
Indirect Ant Script compiler for this object ... so your
analysis WAS correct, except that it's not just the default
compiler that must be changed. Apparently any Java source
object whose designated compiler is an ant compiler, will
cause this. Ouch.
Comment 14 gthb 2002-06-10 16:02:32 UTC
Confirmed by experiment: I commented out that one <attr>
in the .nbattrs and restarted the IDE: all was fine. I'm
taking the liberty of resolving this FIXED again (since I
was the one who incorrectly reopened it)
Comment 15 Tomas Hurka 2002-06-17 09:00:20 UTC
*** Issue 24829 has been marked as a duplicate of this issue. ***
Comment 16 Tomas Hurka 2002-06-19 10:16:48 UTC
*** Issue 24936 has been marked as a duplicate of this issue. ***
Comment 17 Jan Becicka 2002-06-27 12:36:51 UTC
VERIFIED
Comment 18 Quality Engineering 2003-07-01 13:21:34 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.