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 240472

Summary: after update 7.4 to 7.4 patch 2 : ExceptionInInitializerError in CND
Product: debugger Reporter: Exceptions Reporter <exceptions_reporter>
Component: CodeAssignee: Martin Entlicher <mentlicher>
Status: RESOLVED FIXED    
Severity: normal CC: alexvsimon, issues, jtulach, mentlicher
Priority: P3    
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 206474
Attachments: stacktrace
stacktrace

Description Exceptions Reporter 2014-01-14 19:19:01 UTC
This issue was reported manually by alexvsimon.
It already has 1 duplicates 


Build: NetBeans IDE 7.4 (Build 201310111528)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.45-b08, Java(TM) SE Runtime Environment, 1.7.0_45-b18
OS: Windows 8

User Comments:
GUEST: does not work c/c++ modules under Windows 8.1 after update to 7.4 Patch 2




Stacktrace: 
java.lang.NoClassDefFoundError: Could not initialize class org.netbeans.modules.cnd.debugger.common2.debugger.NativeDebuggerManager$LazyInitializer
   at org.netbeans.modules.cnd.debugger.common2.debugger.NativeDebuggerManager$LazyInitializer.access$300(NativeDebuggerManager.java:187)
   at org.netbeans.modules.cnd.debugger.common2.debugger.NativeDebuggerManager.get(NativeDebuggerManager.java:205)
   at org.netbeans.modules.cnd.debugger.common2.debugger.actions.NativeActionsProvider.getDebugger(NativeActionsProvider.java:89)
   at org.netbeans.modules.cnd.debugger.common2.debugger.actions.NativeActionsProvider.<init>(NativeActionsProvider.java:65)
   at org.netbeans.modules.cnd.debugger.common2.debugger.actions.ToggleBreakpointActionProvider.<init>(ToggleBreakpointActionProvider.java:91)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:0)
Comment 1 Exceptions Reporter 2014-01-14 19:19:03 UTC
Created attachment 143964 [details]
stacktrace
Comment 2 Maria Tishkova 2014-02-07 08:27:47 UTC
Will re-assign to updatecenter as in messages log there are a lot if NoClassDefFound for different modules.


As a workaround please remove the userdir C:\Users\user.acme\AppData\Roaming\NetBeans\dev and cachedir C:\Users\user.acme\AppData\Local\NetBeans\Cache\dev and run IDE again.
Comment 3 Alexander Simon 2014-02-11 08:31:25 UTC
Created attachment 145015 [details]
stacktrace

close main.cpp file
Comment 4 Alexander Simon 2014-02-11 08:37:05 UTC
(In reply to Alexander Simon from comment #3)
> Created attachment 145015 [details]
> stacktrace
> 
> close main.cpp file

My steps were:
- replace dev IDE
- start IDE with old user dir
- IDE have opened main.cpp file.
Result:
- exception report on start IDE
- exception report on closing main.cpp
Comment 5 Maria Tishkova 2014-02-11 14:19:43 UTC
*** Bug 241704 has been marked as a duplicate of this bug. ***
Comment 6 Jiri Rechtacek 2014-03-25 15:04:50 UTC
(In reply to Maria Tishkova from comment #2)
> Will re-assign to updatecenter as in messages log there are a lot if
> NoClassDefFound for different modules.
Perhaps Module System than Auto Update.
Comment 7 Jaroslav Tulach 2014-04-04 07:56:17 UTC
The first exception that I see in

http://statistics.netbeans.org/exceptions/messageslog?id=711659

is CCEx which then causes ExceptionInInitializerError in CND - you need to avoid ExceptionInInitializerErrors

Caused: java.lang.ClassCastException: Cannot cast org.netbeans.modules.debugger.jpda.projects.BreakpointAnnotationProvider to org.netbeans.api.debugger.LazyDebuggerManagerListener
	at java.lang.Class.cast(Class.java:3094)
[catch] at org.netbeans.api.debugger.Lookup$MetaInf$MetaInfLookupList$LazyInstance.getEntry(Lookup.java:1144)
	at org.netbeans.api.debugger.Lookup$LookupList$LookupLazyEntry.get(Lookup.java:1296)
	at org.netbeans.api.debugger.LazyArrayList.get(LazyArrayList.java:161)
	at org.netbeans.api.debugger.DebuggerManager.refreshDebuggerManagerListeners(DebuggerManager.java:1527)
	at org.netbeans.api.debugger.DebuggerManager.initDebuggerManagerListeners(DebuggerManager.java:1504)
	at org.netbeans.api.debugger.DebuggerManager.initWatches(DebuggerManager.java:1243)
	at org.netbeans.api.debugger.DebuggerManager.getWatches(DebuggerManager.java:669)
	at org.netbeans.modules.cnd.debugger.common2.debugger.NativeDebuggerManager.getWatches(NativeDebuggerManager.java:1368)
	at org.netbeans.modules.cnd.debugger.common2.debugger.NativeDebuggerManager.watchBag(NativeDebuggerManager.java:1308)
	at org.netbeans.modules.cnd.debugger.common2.debugger.NativeDebuggerManager$LazyInitializer.<clinit>(NativeDebuggerManager.java:200)
	at org.netbeans.modules.cnd.debugger.common2.debugger.NativeDebuggerManager.get(NativeDebuggerManager.java:205)
	at org.netbeans.modules.cnd.debugger.common2.debugger.actions.EvaluateAction.<init>(EvaluateAction.java:67)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	at org.openide.util.SharedClassObject.createInstancePrivileged(SharedClassObject.java:658)
	at org.openide.util.SharedClassObject$SetAccessibleAction.run(SharedClassObject.java:1018)
	at org.openide.util.SharedClassObject$SetAccessibleAction.run(SharedClassObject.java:1010)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.openide.util.SharedClassObject.findObject(SharedClassObject.java:532)
	at org.openide.loaders.InstanceSupport.instanceCreate(InstanceSupport.java:217)
	at org.openide.loaders.InstanceDataObject$Ser.instanceCreate(InstanceDataObject.java:1442)
	at org.openide.loaders.InstanceDataObject.instanceCreate(InstanceDataObject.java:846)
	at org.netbeans.modules.editor.impl.ActionsList.convertImpl(ActionsList.java:147)
	at org.netbeans.modules.editor.impl.ActionsList.<init>(ActionsList.java:85)
	at org.netbeans.modules.editor.impl.PopupMenuActionsProvider.<init>(PopupMenuActionsProvider.java:76)
	at org.netbeans.modules.editor.impl.PopupMenuActionsProvider.createInstance(PopupMenuActionsProvider.java:80)
	at org.netbeans.modules.editor.impl.PopupMenuActionsProvider.createInstance(PopupMenuActionsProvider.java:60)
	at org.netbeans.modules.editor.mimelookup.impl.InstanceProviderLookup.rebuild(InstanceProviderLookup.java:90)
	at org.netbeans.modules.editor.mimelookup.impl.InstanceProviderLookup.initialize(InstanceProviderLookup.java:85)
	at org.openide.util.lookup.AbstractLookup.enterStorage(AbstractLookup.java:176)
	at org.openide.util.lookup.AbstractLookup.lookupItem(AbstractLookup.java:430)
	at org.openide.util.lookup.AbstractLookup.lookup(AbstractLookup.java:421)
	at org.openide.util.lookup.ProxyLookup.lookup(ProxyLookup.java:222)
	at org.netbeans.modules.editor.mimelookup.impl.SwitchLookup.lookup(SwitchLookup.java:90)
	at org.openide.util.lookup.ProxyLookup.lookup(ProxyLookup.java:222)
	at org.netbeans.modules.editor.impl.PopupMenuActionsProvider.getPopupMenuItems(PopupMenuActionsProvider.java:67)
	at org.netbeans.modules.editor.NbEditorKit.call(NbEditorKit.java:1320)
	at org.openide.text.CloneableEditorInitializer.initKit(CloneableEditorInitializer.java:492)
	at org.openide.text.CloneableEditorInitializer.run(CloneableEditorInitializer.java:338)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
ALL [null]: Can not cast instance org.netbeans.modules.debugger.jpda.projects.BreakpointAnnotationProvider@3ee54aed registered in 'null' folder to interface org.netbeans.api.debugger.LazyDebuggerManagerListener. className = null, lookupItem = null
INFO [org.netbeans.modules.editor.impl.ActionsList]: Can't instantiate object
java.lang.NullPointerException
	at org.netbeans.api.debugger.DebuggerManager.refreshDebuggerManagerListeners(DebuggerManager.java:1529)
	at org.netbeans.api.debugger.DebuggerManager.initDebuggerManagerListeners(DebuggerManager.java:1504)
	at org.netbeans.api.debugger.DebuggerManager.initWatches(DebuggerManager.java:1243)
	at org.netbeans.api.debugger.DebuggerManager.getWatches(DebuggerManager.java:669)
	at org.netbeans.modules.cnd.debugger.common2.debugger.NativeDebuggerManager.getWatches(NativeDebuggerManager.java:1368)
	at org.netbeans.modules.cnd.debugger.common2.debugger.NativeDebuggerManager.watchBag(NativeDebuggerManager.java:1308)
	at org.netbeans.modules.cnd.debugger.common2.debugger.NativeDebuggerManager$LazyInitializer.<clinit>(NativeDebuggerManager.java:200)
Caused: java.lang.ExceptionInInitializerError
	at org.netbeans.modules.cnd.debugger.common2.debugger.NativeDebuggerManager.get(NativeDebuggerManager.java:205)
	at org.netbeans.modules.cnd.debugger.common2.debugger.actions.EvaluateAction.<init>(EvaluateAction.java:67)
Comment 8 Jaroslav Tulach 2014-04-04 07:58:05 UTC
Sorry, I closed the bug as incomplete, as the steps to reproduce are not enough for me. Later I added the note about initializer errors. Now the bug is not really incomplete: reopening.

Anyway it is probably sign of some debris in userdir. The only thing to do is to make your code more robust to not generate errors.
Comment 9 Vladimir Voskresensky 2014-04-04 13:32:42 UTC
(In reply to Jaroslav Tulach from comment #8)
> Sorry, I closed the bug as incomplete, as the steps to reproduce are not
> enough for me. Later I added the note about initializer errors. Now the bug
> is not really incomplete: reopening.
> 
> Anyway it is probably sign of some debris in userdir. The only thing to do
> is to make your code more robust to not generate errors.
Why do you think it's CND issue then? The top of the stack is general debugging engine:
Caused: java.lang.ClassCastException: Cannot cast
org.netbeans.modules.debugger.jpda.projects.BreakpointAnnotationProvider to
org.netbeans.api.debugger.LazyDebuggerManagerListener
    at java.lang.Class.cast(Class.java:3094)
[catch] at
org.netbeans.api.debugger.Lookup$MetaInf$MetaInfLookupList$LazyInstance.getEntry(Lookup.java:1144)
    at
org.netbeans.api.debugger.Lookup$LookupList$LookupLazyEntry.get(Lookup.java:1296)
    at org.netbeans.api.debugger.LazyArrayList.get(LazyArrayList.java:161)
    at
org.netbeans.api.debugger.DebuggerManager.refreshDebuggerManagerListeners(DebuggerManager.java:1527)
Comment 10 Ondrej Vrabec 2014-07-16 08:04:14 UTC
not sure how to prevent this, looks as if an instance of org.netbeans.modules.debugger.jpda.projects.BreakpointAnnotationProvider is registered as org.netbeans.api.debugger.LazyDebuggerManagerListener in layer, not sure.
Debugger could potentially revive itself by simply logging the failed cast and check for null in the subsequent code (where the NPE is thrown right now).
Comment 11 Martin Entlicher 2015-04-14 08:49:08 UTC
This code was refactored. The new org.netbeans.modules.debugger.jpda.projectsui.BreakpointAnnotationProvider does not implement and is not registered as LazyDebuggerManagerListener.