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 37147 - Help > Contents throws NPE
Summary: Help > Contents throws NPE
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Help System (show other bugs)
Version: 3.x
Hardware: All All
: P1 blocker (vote)
Assignee: _ tboudreau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-11 15:36 UTC by John Jullion-ceccarelli
Modified: 2008-12-22 18:54 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NPE thrown (1.26 KB, text/plain)
2003-11-11 15:38 UTC, John Jullion-ceccarelli
Details
log file (146.96 KB, text/plain)
2003-11-12 09:58 UTC, John Jullion-ceccarelli
Details
Detailed log to track this problem (26.48 KB, text/plain)
2003-11-12 15:24 UTC, Tomas Hurka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Jullion-ceccarelli 2003-11-11 15:36:39 UTC
For each IDE session, the first time you choose
Help > Contents or otherwise merge and display the
help, you get an NPE. The help still merges and
displays correctly, and it only occurs the first
time you view the help.

I set the priority to P2 because it's causing
builds to fail the commit validation test. I think
it's because on Solaris this error pops up a
dialog that has to be dismissed before the help
will display, and that causes the test to hang.
Comment 1 John Jullion-ceccarelli 2003-11-11 15:38:51 UTC
Created attachment 12107 [details]
NPE thrown
Comment 2 Jesse Glick 2003-11-11 16:51:04 UTC
Looks like a bug in Datasystems - XMLDataObject.Processor.attachTo has
not been called by the time instanceCreate is called?!

John if you can reproduce this (I can't) you *must* run with

-J-Dorg.netbeans.modules.javahelp=0

and include the full log file, or the stack trace is useless.
Comment 3 John Jullion-ceccarelli 2003-11-12 09:57:47 UTC
Here is the log file with the switch turned on. This bug is probably
related to http://www.netbeans.org/issues/show_bug.cgi?id=37088. The
last two or three sessions in the log file were run with the switch.
Comment 4 John Jullion-ceccarelli 2003-11-12 09:58:38 UTC
Created attachment 12115 [details]
log file
Comment 5 Jesse Glick 2003-11-12 10:28:05 UTC
Strange. Still looks like a Datasystems bug to me. Well Tim if you can
reproduce it, have fun.
Comment 6 _ tboudreau 2003-11-12 14:20:48 UTC
Oy veh!

Jesse, I have no clue at all about XMLDataObject, etc., so this may
take a while.  Can you give me some textual description of what you
think is going on to try to get a head start on it?
Comment 7 _ ttran 2003-11-12 14:41:34 UTC
-> P1, commit validation is failing
Comment 8 Tomas Hurka 2003-11-12 15:21:40 UTC
Fixed in trunk.
Checking in HelpSetProcessor.java;
/cvs/core/javahelp/src/org/netbeans/modules/javahelp/HelpSetProcessor.java,v  <--  
HelpSetProcessor.java
new revision: 1.10; previous revision: 1.9
done
HelpSetProcessor.createInstance() must be synchronized, since it can be called from 
unserialized Lookup. getInstance(). 
Comment 9 Tomas Hurka 2003-11-12 15:24:48 UTC
Created attachment 12125 [details]
Detailed log to track this problem
Comment 10 Jesse Glick 2003-11-12 17:28:17 UTC
Tomas can you explain further why this method needed to be
synchronized, as I still think Lookup and/or XMLDataObject is at fault
here? It looks like the instance field 'xml' is null when
instanceCreate is called, meaning that attachTo had not been called on
the HSP instance first (or was called with a null argument). Is this
true, or what is happening instead?

I.e. even if it is true that instanceCreate should be synchronized to
avoid creating multiple HelpSet objects, that does not explain why the
NPE occurred, AFAICT.
Comment 11 Jesse Glick 2003-11-14 11:08:14 UTC
Sorry, I was looking at the wrong line. AFAICT the NPE was coming from
this:

Element el = doc.getDocumentElement();
if (! el.getNodeName().equals("helpsetref")) // <- here
    throw new IOException();

meaning that XMLDataObject.getDocument() was returning a Document impl
with documentElement == null. Isn't this a Datasystems bug rather than
a core/javahelp bug?
Comment 12 Tomas Hurka 2003-11-14 13:21:17 UTC
You are probably right. I was briefly looking at XMLDataObject.getDocumentImpl 
(boolean force) and I think that it can create two Document objects. The synchronize 
section at the begging is to short - if two thread quickly call it, we will have two 
Documents. It still does not explain NPE, but this is another problem, which should be 
fixed. Maybe implementation of EntityResolver is responsible for that NPE.
Comment 13 Jesse Glick 2003-11-14 14:52:47 UTC
OK, well if you think something is still wrong please file a bug about
it (maybe make it block this one).
Comment 14 Marian Mirilovic 2003-11-25 17:43:15 UTC
verified in [nb_dev](200311241900)