Bug 166236 - NPE/AE from ErrorAnnotator.<clinit>
NPE/AE from ErrorAnnotator.<clinit>
Status: RESOLVED FIXED
Product: editor
Classification: Unclassified
Component: Parsing & Indexing
6.x
All All
: P2 with 3 votes (vote)
: 7.0.1
Assigned To: Jaroslav Tulach
issues@editor
http://statistics.netbeans.org/except...
EXCEPTIONS_REPORT
: 7.0_WAIVER_APPROVED, ERGONOMICS
: 178042 178088 181803 182221 183533 184898 185916 186872 189474 190728 197636 198323 198324 198865 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-29 09:38 UTC by limo42
Modified: 2011-05-25 18:16 UTC (History)
79 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
stacktrace (4.16 KB, text/plain)
2009-05-29 09:38 UTC, limo42
Details
stacktrace (4.16 KB, text/plain)
2009-05-29 09:41 UTC, limo42
Details
when trying to create a new java project (87.40 KB, image/png)
2009-12-03 12:10 UTC, eladkatz
Details
stacktrace (1.97 KB, text/plain)
2010-01-21 10:31 UTC, alied
Details
stacktrace (840 bytes, text/plain)
2010-01-21 11:21 UTC, alied
Details
stacktrace (1.98 KB, text/plain)
2010-05-04 16:17 UTC, Jesse Glick
Details
stacktrace (1.61 KB, text/plain)
2010-05-24 10:11 UTC, malakim
Details
stacktrace (3.12 KB, text/plain)
2010-05-27 05:35 UTC, malakim
Details
stacktrace (1.61 KB, text/plain)
2010-05-28 08:08 UTC, Marian Mirilovic
Details
stacktrace (3.12 KB, text/plain)
2010-06-08 22:57 UTC, Michel Graciano
Details
stacktrace (1.61 KB, text/plain)
2010-06-25 08:59 UTC, Antonin Nebuzelsky
Details
stacktrace (3.12 KB, text/plain)
2010-07-19 12:48 UTC, Oleg Khokhlov
Details
stacktrace (1.61 KB, text/plain)
2011-01-25 15:09 UTC, lazarius
Details
stacktrace (1.61 KB, text/plain)
2011-02-15 12:22 UTC, aldobrucale
Details
stacktrace (3.12 KB, text/plain)
2011-03-03 10:07 UTC, aldobrucale
Details
stacktrace (3.12 KB, text/plain)
2011-03-24 14:33 UTC, aldobrucale
Details
stacktrace (1.61 KB, text/plain)
2011-04-11 23:30 UTC, swpalmer
Details
stacktrace (1.98 KB, text/plain)
2011-04-12 00:54 UTC, swpalmer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description limo42 2009-05-29 09:38:00 UTC
Build: NetBeans IDE Dev (Build 200905250001)
VM: Java HotSpot(TM) Server VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Linux, 2.6.27.21-170.2.56.fc10.i686, i386

Stacktrace: 
org.openide.util.RequestProcessor$Item: task failed due to: java.lang.NoClassDefFoundError: Could not initialize class org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem
        at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:630)
        at org.netbeans.core.ui.warmup.MenuWarmUpTask$NbWindowsAdapter.windowActivated(MenuWarmUpTask.java:133)
        at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.java:373)
        at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.java:372)
        at java.awt.Window.processWindowEvent(Window.java:1874)
        at javax.swing.JFrame.processWindowEvent(JFrame.java:279)
Comment 1 limo42 2009-05-29 09:38:14 UTC
Created attachment 82959 [details]
stacktrace
Comment 2 limo42 2009-05-29 09:41:02 UTC
Build: NetBeans IDE Dev (Build 200905250001)
VM: Java HotSpot(TM) Server VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Linux, 2.6.27.21-170.2.56.fc10.i686, i386

User Comments: 


Stacktrace: 
org.openide.util.RequestProcessor$Item: task failed due to: java.lang.NoClassDefFoundError: Could not initialize class org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem
        at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:630)
        at org.netbeans.core.ui.warmup.MenuWarmUpTask$NbWindowsAdapter.windowActivated(MenuWarmUpTask.java:133)
        at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.java:373)
        at java.awt.AWTEventMulticaster.windowActivated(AWTEventMulticaster.java:372)
        at java.awt.Window.processWindowEvent(Window.java:1874)
        at javax.swing.JFrame.processWindowEvent(JFrame.java:279)
Comment 3 limo42 2009-05-29 09:41:13 UTC
Created attachment 82962 [details]
stacktrace
Comment 4 Jiri Skrivanek 2009-06-02 13:34:08 UTC
Seems to be a class loading problem at early stages of startup sequence. Steps how to reproduce would be helpful.
Comment 5 Jesse Glick 2009-06-02 15:44:53 UTC
Probably a corrupt IDE installation.
Comment 6 limo42 2009-06-02 17:05:28 UTC
Rather seems like a corrupt userdir, removing ~/.netbeans did help.
Unfortuntately, I didn't store a copy somewhere for deeper analysis.
Comment 7 Jesse Glick 2009-06-02 18:21:08 UTC
Right, a copy of the userdir (or at least certain critical parts) would be helpful for diagnosis. Could ultimately have
been a bug in Plugin Manager, but hard to guess.
Comment 8 limo42 2009-06-07 16:50:58 UTC
The problem happened during IDE restart after uninstalling a few plugins.
I cannot reproduce this anymore in NB 6.7rc2 -- so all's ok with me now.
Comment 9 Jesse Glick 2009-12-03 06:03:48 UTC
*** Bug 178042 has been marked as a duplicate of this bug. ***
Comment 10 Jesse Glick 2009-12-03 06:09:44 UTC
Exception reporter is just going to keep on filing duplicates so no point in closing. Initial problems seem to be e.g.

java.lang.NullPointerException: The image parameter cannot be null
	at org.openide.util.Parameters.notNull(Parameters.java:86)
	at org.openide.util.ImageUtilities.assignToolTipToImage(ImageUtilities.java:230)
	at org.netbeans.modules.java.source.tasklist.ErrorAnnotator.<clinit>(ErrorAnnotator.java:93)

which looks to be some problem with ImageUtilities not loading an icon, but I don't know why. Possibly JAR cache issue. Not sure if could be ergonomics-related.
Comment 11 Jesse Glick 2009-12-03 06:13:29 UTC
ede3943946ad from bug #174055 may help with robustness, but probably something serious is wrong.
Comment 12 Jesse Glick 2009-12-03 10:00:53 UTC
*** Bug 178088 has been marked as a duplicate of this bug. ***
Comment 13 eladkatz 2009-12-03 12:09:22 UTC
I can upload my .netbeans directory but it's ~350MB, ~5000 files.
is there anything specific you need from it?
My next step will be to install 5.8rc and see if it fixes it
also, now i can get it running every once in a while (after trying to do it a few times, but i can't do some things like create a new simple java project.
I'm getting the message in the picture i'm gonna attach
Comment 14 eladkatz 2009-12-03 12:10:07 UTC
Created attachment 92069 [details]
when trying to create a new java project
Comment 15 Jesse Glick 2009-12-03 15:45:31 UTC
(In reply to comment #13)
> i can't do some things like create a new simple java project.
> I'm getting the message in the picture i'm gonna attach

This problem would go away, or at least take a more straightforward form, if you deleted the ergonomics<number> directory in your NetBeans installation. (It is always safe to delete the ergonomics directory; it just delays turning on certain plugins, but you can always configure which plugins you want on or off in Plugin Manager anyway.) Whether ergonomics is responsible for the root error in your case, I don't know.

If you can reproduce the problem with your current user directory, and have a bit of time to spare, make a backup copy of it and then narrow down the problem by bisecting deletes: move aside half of the subdirectories at random, start the IDE, if everything is OK then restore half of them, else move aside half of the remaining directories, etc. At some point you will find that the presence of a particular file causes the problem. In this case I suspect var/cache/<something>.dat but that's just a guess. (As a general rule, if the userdir is triggering some bug, it can be worked around by removing the responsible portion of the userdir; put another way, if a given userdir does _not_ trigger the bug, a subset of the userdir will probably not trigger it either.)
Comment 16 eladkatz 2009-12-04 08:19:34 UTC
(In reply to comment #15)
> (In reply to comment #13)
> > i can't do some things like create a new simple java project.
> > I'm getting the message in the picture i'm gonna attach
> 
> This problem would go away, or at least take a more straightforward form, if
> you deleted the ergonomics<number> directory in your NetBeans installation. (It
> is always safe to delete the ergonomics directory; it just delays turning on
> certain plugins, but you can always configure which plugins you want on or off
> in Plugin Manager anyway.) Whether ergonomics is responsible for the root error
> in your case, I don't know.
> 
> If you can reproduce the problem with your current user directory, and have a
> bit of time to spare, make a backup copy of it and then narrow down the problem
> by bisecting deletes: move aside half of the subdirectories at random, start
> the IDE, if everything is OK then restore half of them, else move aside half of
> the remaining directories, etc. At some point you will find that the presence
> of a particular file causes the problem. In this case I suspect
> var/cache/<something>.dat but that's just a guess. (As a general rule, if the
> userdir is triggering some bug, it can be worked around by removing the
> responsible portion of the userdir; put another way, if a given userdir does
> _not_ trigger the bug, a subset of the userdir will probably not trigger it
> either.)

That actually worked!
installing 5.8 rc1 also worked...
Comment 17 Petr Nejedly 2009-12-04 12:14:06 UTC
> That actually worked!
What? Deleting ergonomics or deleting the userdir?
If you still have the old userdir around, it would probably be much smaller without var/cache/index/*, which is, for sure, unrelated to this problem. Then it might be much easier to pack it and send it.
Comment 18 eladkatz 2009-12-04 13:34:29 UTC
(In reply to comment #17)
> > That actually worked!
> What? Deleting ergonomics or deleting the userdir?
> If you still have the old userdir around, it would probably be much smaller
> without var/cache/index/*, which is, for sure, unrelated to this problem. Then
> it might be much easier to pack it and send it.

Deleting ergonomics
Comment 19 Jesse Glick 2009-12-04 13:49:08 UTC
Interesting.
Comment 20 Quality Engineering 2009-12-04 16:15:48 UTC
Integrated into 'main-golden', will be available in build *200912041400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/b6b8630288e3
User: Jesse Glick <jglick@netbeans.org>
Log: Some diagnostics for #166236.
Comment 21 alied 2010-01-21 10:31:11 UTC
Created attachment 93457 [details]
stacktrace

after last update
Comment 22 alied 2010-01-21 11:21:43 UTC
Created attachment 93461 [details]
stacktrace

Caused: java.lang.NoClassDefFoundError: org/netbeans/modules/masterfs/providers/AnnotationProvider while loading org.netbeans.modules.parsing.impl.indexing.errorsorg.netbeans.modules.parsing.impl.indexing.errors.ErrorAnnotator; see http://wiki.netbeans.org/DevFaqTroubleshootClassNotFound
Interesting this part:
org.netbeans.modules.parsing.impl.indexing.errorsorg.netbeans.modules.parsing.impl.indexing.errors.ErrorAnnotator
does it actually tries to load this class, or the logger just forgot to add a " " or "\n"? betweem classes?
PLS, I'd give this at least P2, for it's a stopper (if we were in NetCAT69, this would be a beta stopper)
Comment 23 Jesse Glick 2010-01-21 15:31:26 UTC
alied: your exception is something else (bug #179761) and is the result of using updates from the alpha update center in a development build, which may work but is never supported.
Comment 24 Jesse Glick 2010-03-10 17:08:22 UTC
*** Bug 181803 has been marked as a duplicate of this bug. ***
Comment 25 Jesse Glick 2010-03-17 15:24:08 UTC
*** Bug 182221 has been marked as a duplicate of this bug. ***
Comment 26 Ondrej Vrabec 2010-04-07 07:34:00 UTC
*** Bug 183533 has been marked as a duplicate of this bug. ***
Comment 27 Jesse Glick 2010-04-26 15:14:58 UTC
*** Bug 184898 has been marked as a duplicate of this bug. ***
Comment 28 Jesse Glick 2010-05-04 16:17:20 UTC
Created attachment 98447 [details]
stacktrace

Restarted IDE with old userdir (with j2seproject open) using a new config=bloated dev build incl. ergonomics.
Comment 29 Jesse Glick 2010-05-11 17:30:25 UTC
*** Bug 185916 has been marked as a duplicate of this bug. ***
Comment 30 malakim 2010-05-24 10:11:25 UTC
Created attachment 99380 [details]
stacktrace

Thrown on IDE launch
Comment 31 malakim 2010-05-27 05:35:34 UTC
Created attachment 99521 [details]
stacktrace

IDE startup, importing settings from NB 6.8
Comment 32 Marian Mirilovic 2010-05-28 08:08:40 UTC
Created attachment 99586 [details]
stacktrace

Imported settings from NB 6.8 and started new RC2 build
Comment 33 Jesse Glick 2010-05-28 15:51:05 UTC
*** Bug 186872 has been marked as a duplicate of this bug. ***
Comment 34 Michel Graciano 2010-06-08 22:57:36 UTC
Created attachment 99916 [details]
stacktrace
Comment 35 Antonin Nebuzelsky 2010-06-25 08:59:22 UTC
Created attachment 100417 [details]
stacktrace

After first start of this trunk build with settings imported from 6.9. Two projects open (AnagramGame and Paint Application samples).
Comment 36 Oleg Khokhlov 2010-07-19 12:48:46 UTC
Created attachment 100912 [details]
stacktrace

started IDE with opened nb module
Comment 37 Jesse Glick 2010-08-13 12:12:32 UTC
*** Bug 189474 has been marked as a duplicate of this bug. ***
Comment 38 b166er 2010-09-20 22:28:15 UTC
remove me from CC List
Comment 39 Jesse Glick 2010-10-04 23:15:24 UTC
*** Bug 190728 has been marked as a duplicate of this bug. ***
Comment 40 lazarius 2011-01-25 15:09:33 UTC
Created attachment 105335 [details]
stacktrace

Just started the IDE.
Comment 41 aldobrucale 2011-02-15 12:22:28 UTC
Created attachment 106027 [details]
stacktrace

Starting nb after import from 6.9
Comment 42 aldobrucale 2011-03-03 10:07:15 UTC
Created attachment 106642 [details]
stacktrace

Starting netbeans after import from 6.9
Comment 43 aldobrucale 2011-03-24 14:33:57 UTC
Created attachment 107244 [details]
stacktrace

Starting netbeans for the first time (import settings fron 6.9.1)
Comment 44 swpalmer 2011-04-11 23:30:33 UTC
Created attachment 107655 [details]
stacktrace

Imported 6.9.1 settings which caused a workspace with several Java and C/C++ projects.
Comment 45 swpalmer 2011-04-12 00:54:33 UTC
Created attachment 107659 [details]
stacktrace

Switching to a newly created project group and attempting to open a project
Comment 46 Jaroslav Tulach 2011-04-13 15:58:33 UTC
The error is: [69cat] NoClassDefFoundError: Could not initialize class org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem
Comment 47 Jaroslav Tulach 2011-04-13 16:01:11 UTC
This is a report comming from 7.0RC2:
http://statistics.netbeans.org/exceptions/exception.do?id=503127

All problems seem to start at
WARNING [org.openide.util.lookup.MetaInfServicesLookup]: Cannot create class org.netbeans.modules.parsing.impl.indexing.errors.ErrorAnnotator
java.lang.NullPointerException: The image parameter cannot be null
	at org.openide.util.Parameters.notNull(Parameters.java:89)
	at org.openide.util.ImageUtilities.assignToolTipToImage(ImageUtilities.java:240)
	at org.netbeans.modules.parsing.impl.indexing.errors.ErrorAnnotator.<clinit>(ErrorAnnotator.java:106)
Caused: java.lang.ExceptionInInitializerError

Making ErrorAnnotator static initializers more bulletproof would help NetBeans IDE to start.
Comment 48 Jesse Glick 2011-04-13 16:08:19 UTC
ErrorAnnotator is calling ImageUtilities.loadImage from a static initializer, which relies on the global class loader being ready and containing o-n-m-parsing-api.jar. All the recent duplicates I can see suggest that this code is being loaded during import, before the module system has even started! It is not surprising that this does not work; the question is what about import is triggering this code, and whether there is a way to reproduce it. Ergonomics is implicated in the call stack - suspicious that the open project list would be loaded during settings import.

Probable fix for the immediate exception is to remove the static initializer block and just construct the icons on demand - ImageUtilities does its own caching anyway.
Comment 49 Jan Lahoda 2011-04-13 17:20:03 UTC
Very well:
http://hg.netbeans.org/jet-main/rev/3d395b70ae5f

(Seems to me like a workaround for a disagreement between ergonomics (see comment #18), module system and Lookup, but ergonomics of course does not have any bugs.)

Please either close the bug, if you consider this to be the correct solution, or take it back to platform or ergonomics if it is not.
Comment 50 Jesse Glick 2011-04-13 18:05:12 UTC
Assigning to jtulach to investigate why this code would be running during settings import.
Comment 51 Jaroslav Tulach 2011-04-14 05:49:20 UTC
ErrorAnnotator is instantiated as early is that it piggy backs on masterfs annotation API designed for completely different purpose - e.g. version control systems. As soon as MasterFS is needed, it gets instantiated.

MasterFS is needed because when calling OpenProjects.getDefault() the project system starts to load list of recently opened projects.

Ergonomics need to attach listener to OpenProjects.getDefault() to observer opened project types and enabled needed modules.

Ergonomics are being initialized so early as their FoDFileSystem is part of system filesystem (and thus it is needed before modules even start).
Comment 52 Quality Engineering 2011-04-14 08:38:51 UTC
Integrated into 'main-golden', will be available in build *201104140401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3d395b70ae5f
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #166236: delaying loading of icons as requested.
Comment 53 Jaroslav Tulach 2011-04-15 05:57:49 UTC
I hoped to delay OpenProjectList.RecentProjectList.load(). That way the OpenProjectList.getDefault() would finish without dealing with masterfs. However such change is not going to be very easy and is definitely risky.
Comment 54 Jesse Glick 2011-04-15 17:42:54 UTC
More appropriate summary.
Comment 55 Jaroslav Tulach 2011-04-19 16:34:56 UTC
I can attach the OpenProjects listener in ModuleInstall.resume(): ergonomics#85865ace98fd

Each of these fixes should be enough to mark the issue fixed, right?
Comment 56 Jaroslav Tulach 2011-04-20 06:49:58 UTC
*** Bug 197636 has been marked as a duplicate of this bug. ***
Comment 57 Quality Engineering 2011-04-22 05:07:00 UTC
Integrated into 'main-golden', will be available in build *201104220000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/85865ace98fd
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #166236: Attach listener to OpenProjects in ModuleInstall
Comment 58 Jesse Glick 2011-05-06 12:05:42 UTC
*** Bug 198324 has been marked as a duplicate of this bug. ***
Comment 59 Jan Lahoda 2011-05-09 10:57:23 UTC
*** Bug 198323 has been marked as a duplicate of this bug. ***
Comment 60 Jan Lahoda 2011-05-25 18:16:00 UTC
*** Bug 198865 has been marked as a duplicate of this bug. ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo