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 174055 - NoClassDefFoundError: Could not initialize class org.netbeans.api.project.ui.OpenProjects
Summary: NoClassDefFoundError: Could not initialize class org.netbeans.api.project.ui....
Status: CLOSED INCOMPLETE
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Nejedly
URL: http://statistics.netbeans.org/except...
Keywords:
: 178338 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-08 10:22 UTC by Marian Mirilovic
Modified: 2010-04-21 12:35 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 154112


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2009-10-08 10:22:03 UTC
99 duplicates ... latest against Nb 6.7.1 ... so maybe already fixed ?


Build: NetBeans IDE 6.7.1 (Build 200906241340)
VM: OpenJDK Client VM, 14.0-b08, OpenJDK Runtime Environment, 1.6.0_0-b14
OS: Linux, 2.6.28-15-generic, i386
User comments: 

Stacktrace: 
java.lang.NoClassDefFoundError: Could not initialize class org.netbeans.api.project.ui.OpenProjects
        at org.netbeans.modules.search.project.SearchScopeOpenProjects.checkIsApplicable(SearchScopeOpenProjects.java:73)
        at org.netbeans.modules.search.AbstractSearchScope.isApplicable(AbstractSearchScope.java:79)
        at org.netbeans.modules.search.SearchScopeRegistry.checkIsApplicable(SearchScopeRegistry.java:435)
        at org.netbeans.modules.search.SearchScopeRegistry.hasApplicableSearchScope(SearchScopeRegistry.java:368)
        at org.netbeans.modules.search.FindInFilesAction$LookupSensitive.isEnabled(FindInFilesAction.java:491)
        at org.openide.util.actions.CallbackSystemAction.updateEnabled(CallbackSystemAction.java:157)
        at org.openide.util.actions.CallbackSystemAction.setActionPerformer(CallbackSystemAction.java:146)
        at org.openide.util.actions.CallbackSystemAction.clearActionPerformers(CallbackSystemAction.java:320)
        at org.openide.util.actions.CallbackSystemAction.access$100(CallbackSystemAction.java:76)
        at org.openide.util.actions.CallbackSystemAction$GlobalManager$1.run(CallbackSystemAction.java:436)
        at org.openide.util.Mutex.doEvent(Mutex.java:1335)
Comment 1 Victor Vasilyev 2009-10-08 15:08:30 UTC
I can't reproduce this issue on the dev build.

Investigation results:
----------------------

* The OpenProjects class is located in the projectuiapi (Project UI API) module in the public package
org.netbeans.api.project.ui
* The SearchScopeOpenProjects class is located in the utilities.project (Projects Searching) module, and the module has
got an explicit dependency on the projectuiapi (Project UI API) module.
* Access to the OpenProjects class is implemented via very simple expression:
SearchScopeOpenProjects.java:
:73:    protected boolean checkIsApplicable() {
:74:        return OpenProjects.getDefault().getOpenProjects().length > 0;
:75:    }

I guess the all points mentioned above are enough to provide correct use of the API.

I've found only one minor violation in source of the SearchScopeOpenProjects class:
the import statement for the org.netbeans.api.project.ui.OpenProjects is duplicated. 
But, I hope, it is not a cause of this issue ;-)

Hence, nothing can/should be fixed on the caller side in the utilities.project (Projects Searching) module.

Moreover, the NoClassDefFoundError explains that the class couldn't be initialized, but it means that the class is
accessible. Unfortunately, I've not any ideas why it is not possible to complete both initialization of the static
fields of the OpenProjects class and its constructor.
----------------------

I'll reassign this issue to an owner of the projectuiapi (Project UI API) module.
Could you please, verify my points, and close this issue if all is OK in the latest version.
Comment 2 Milos Kleint 2009-10-09 07:37:38 UTC
there seem to be many other unrelated couldnotinitialize exceptions in the log, I suppose it's module system or
ergonomics related.
Comment 3 Jesse Glick 2009-10-09 13:08:14 UTC
Looks like problems loading icons:

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.javafx.source.tasklist.FXErrorAnnotator.<clinit>(FXErrorAnnotator.java:95)

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)

Before that, usually (not always) failed module updates. Don't know what's going on. All reporters seem to be using
ergonomics.

BTW number of duplicates is artificially high; usually same people reporting over and over.

I can make MetaInfServicesLookup more robust against ExceptionInInitializerError's, but that will probably not really
solve the issue.
Comment 4 Exceptions Reporter 2009-10-13 17:53:48 UTC
This issue already has 100 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=154112
Comment 5 Petr Nejedly 2009-10-14 09:26:34 UTC
Unreproducible, most likely related to broken updates. Reducing prio.
Comment 6 Quality Engineering 2009-10-14 11:01:26 UTC
Integrated into 'main-golden', will be available in build *200910140201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ede3943946ad
User: Jesse Glick <jglick@netbeans.org>
Log: Improved robustness against errors in static initializers, as noticed in #174055.
Comment 7 Jaroslav Tulach 2010-01-05 03:53:34 UTC
MetaInfServicesLookup straighten up by bce0bea530c8
Comment 8 Jesse Glick 2010-01-06 17:40:33 UTC
*** Bug 178338 has been marked as a duplicate of this bug. ***
Comment 9 Marian Mirilovic 2010-04-21 12:35:35 UTC
v/c