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.
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.
Created attachment 12107 [details] NPE thrown
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.
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.
Created attachment 12115 [details] log file
Strange. Still looks like a Datasystems bug to me. Well Tim if you can reproduce it, have fun.
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?
-> P1, commit validation is failing
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().
Created attachment 12125 [details] Detailed log to track this problem
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.
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?
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.
OK, well if you think something is still wrong please file a bug about it (maybe make it block this one).
verified in [nb_dev](200311241900)