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 159608 - Can not cast instance org.netbeans.modules.ide.ergonomics.debugger.AttachTypeProxy@49ea52ee registered in 'null' folder to interface org.netbeans.api.debugger.Properties$Initializer
Summary: Can not cast instance org.netbeans.modules.ide.ergonomics.debugger.AttachType...
Status: RESOLVED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Features On Demand (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Jaroslav Tulach
URL: http://statistics.netbeans.org/except...
Keywords: THREAD
: 159418 (view as bug list)
Depends on: 159663
Blocks:
  Show dependency tree
 
Reported: 2009-03-04 13:52 UTC by fleka
Modified: 2009-06-21 13:43 UTC (History)
16 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 146918


Attachments
stacktrace (7.34 KB, text/plain)
2009-03-04 13:52 UTC, fleka
Details
stacktrace (5.79 KB, text/plain)
2009-03-05 09:21 UTC, Jiri Prox
Details
stacktrace (1.63 KB, text/plain)
2009-03-09 12:27 UTC, Martin Schovanek
Details
stacktrace (1.64 KB, text/plain)
2009-03-10 20:02 UTC, Erno Mononen
Details
stacktrace (1.63 KB, text/plain)
2009-03-12 07:04 UTC, esmithbss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fleka 2009-03-04 13:52:05 UTC
Build: NetBeans IDE Dev (Build 200903031401)
VM: Java HotSpot(TM) 64-Bit Server VM, 11.2-b01, Java(TM) SE Runtime Environment, 1.6.0_12-b04
OS: Windows Vista, 6.0, amd64

User Comments:
pjiricka: Enabling the JavaEE functionality

GUEST: To reproduce this bug:
1 delete .netbeans directory
2 start netbeans dev build 200903021401
3 go to Tools > Plugins and select the Installed tab
4 select and activate the Java EE plugin

GUEST: ??n't activate PHP application

GUEST: creating a new PHP project.



Stacktrace: 
java.lang.ClassCastException
        at java.lang.Class.cast(Class.java:2990)
        at org.netbeans.api.debugger.Lookup$MetaInf$MetaInfLookupList$LazyInstance.getEntry(Lookup.java:707)
        at org.netbeans.api.debugger.Lookup$LookupList$LookupLazyEntry.get(Lookup.java:808)
        at org.netbeans.api.debugger.LazyArrayList.get(LazyArrayList.java:158)
        at org.netbeans.api.debugger.LazyArrayList$Itr.next(LazyArrayList.java:215)
        at org.netbeans.api.debugger.Properties$PropertiesImpl$ServicesHolder.init(Properties.java:576)
Comment 1 fleka 2009-03-04 13:52:09 UTC
Created attachment 77717 [details]
stacktrace
Comment 2 Martin Entlicher 2009-03-04 15:34:38 UTC
*** Issue 159418 has been marked as a duplicate of this issue. ***
Comment 3 Martin Entlicher 2009-03-04 16:42:40 UTC
Looks like some inconsistency of Lookups.forPath() during enabling of a lot of modules.

It's not a deterministic bug, though it occurs very often.
Comment 4 Jiri Prox 2009-03-05 09:21:20 UTC
Build: NetBeans IDE Dev (Build 20090304130206)
VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: Linux, 2.6.24-23-generic, i386

User Comments: 
CCE exception when activating WebApplications while creating new project

Stacktrace: 
java.lang.ClassCastException
        at java.lang.Class.cast(Class.java:2990)
        at org.netbeans.api.debugger.Lookup$MetaInf$MetaInfLookupList$LazyInstance.getEntry(Lookup.java:707)
        at org.netbeans.api.debugger.Lookup$LookupList$LookupLazyEntry.get(Lookup.java:808)
        at org.netbeans.api.debugger.LazyArrayList.get(LazyArrayList.java:158)
        at org.netbeans.api.debugger.LazyArrayList$Itr.next(LazyArrayList.java:215)
        at org.netbeans.api.debugger.Properties$PropertiesImpl$ServicesHolder.init(Properties.java:576)
Comment 5 Jiri Prox 2009-03-05 09:21:30 UTC
Created attachment 77750 [details]
stacktrace
Comment 6 Martin Entlicher 2009-03-05 09:37:04 UTC
Very visible bug -> P2.
Comment 7 Martin Entlicher 2009-03-05 09:40:52 UTC
This should not be thrown after restart of NetBeans. The bug is triggered by installation of modules.

Probably a race-condition in Lookups.forPath().

However, o.n.a.d.Lookup should be improved not to create so much refresh processes. Improved threading can hide the
problem again.
Comment 8 Martin Schovanek 2009-03-09 12:27:41 UTC
Build: NetBeans IDE Dev (Build 200903090201)
VM: Java HotSpot(TM) Client VM, 1.5.0_16-133, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_16-b06-284
OS: Mac OS X, 10.5.6, i386

User Comments: 
1) create a new Depot sample app + activate Ruby fature
2) copy paste Views > store > index.rhtml


Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.api.debugger.Properties$PropertiesImpl$InitializerHolder.registerService(Properties.java:673)
        at org.netbeans.api.debugger.Properties$PropertiesImpl$InitializerHolder.registerService(Properties.java:664)
        at org.netbeans.api.debugger.Properties$PropertiesImpl$ServicesHolder.init(Properties.java:577)
        at org.netbeans.api.debugger.Properties$PropertiesImpl$ServicesHolder.find(Properties.java:608)
        at org.netbeans.api.debugger.Properties$PropertiesImpl.getInitialValue(Properties.java:696)
        at org.netbeans.api.debugger.Properties$PropertiesImpl.getArray(Properties.java:993)
Comment 9 Martin Schovanek 2009-03-09 12:27:51 UTC
Created attachment 77903 [details]
stacktrace
Comment 10 Vladimir Voskresensky 2009-03-09 13:56:21 UTC
why is it RANDOM?
It is 100% reproducible.
For instance:
- start IDE with clean userdir
- create any sample C++ project
- open any C/C++ file of the project in editor
Comment 11 Martin Entlicher 2009-03-10 18:05:21 UTC
I've marked this as random, because the nature of the bug is random. The fact that this happens in 90% of attempts does
not mean that it's not random.
Comment 12 Martin Entlicher 2009-03-10 18:27:43 UTC
The described steps:

- start IDE with clean userdir
- create any sample C++ project
- open any C/C++ file of the project in editor

probably point to a different problem, because the exception after these steps is thrown even after I get rid of the
exception after activation of the Java EE plugin.
Comment 13 Martin Entlicher 2009-03-10 19:08:15 UTC
The behavior should be better after the fix of issue #159663, though it's not fully fixed yet, the steps with C++
project still lead to the exception.
Comment 14 Erno Mononen 2009-03-10 20:02:18 UTC
Build: NetBeans IDE Dev (Build 090310)
VM: Java HotSpot(TM) 64-Bit Server VM, 1.5.0_16-b02, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_16-b02
OS: Linux, 2.6.27-11-generic, amd64

User Comments: 
Started up the IDE with one Java and a couple of Rails projects open.

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.api.debugger.Properties$PropertiesImpl$InitializerHolder.registerService(Properties.java:673)
        at org.netbeans.api.debugger.Properties$PropertiesImpl$InitializerHolder.registerService(Properties.java:664)
        at org.netbeans.api.debugger.Properties$PropertiesImpl$ServicesHolder.init(Properties.java:577)
        at org.netbeans.api.debugger.Properties$PropertiesImpl$ServicesHolder.find(Properties.java:608)
        at org.netbeans.api.debugger.Properties$PropertiesImpl.getInitialValue(Properties.java:696)
        at org.netbeans.api.debugger.Properties$PropertiesImpl.getArray(Properties.java:993)
Comment 15 Erno Mononen 2009-03-10 20:02:31 UTC
Created attachment 78005 [details]
stacktrace
Comment 16 esmithbss 2009-03-12 07:04:31 UTC
Build: NetBeans IDE Dev (Build 200903110259)
VM: Java HotSpot(TM) Client VM, 11.2-b01, Java(TM) SE Runtime Environment, 1.6.0_12-b04
OS: Windows XP, 5.1, x86

User Comments: 
Just updated rails to 2.2.2 to match project. (Had earlier updated rubygems to 1.3.1)

Attempting to generate controller and views for existing database table.

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.api.debugger.Properties$PropertiesImpl$InitializerHolder.registerService(Properties.java:673)
        at org.netbeans.api.debugger.Properties$PropertiesImpl$InitializerHolder.registerService(Properties.java:664)
        at org.netbeans.api.debugger.Properties$PropertiesImpl$ServicesHolder.init(Properties.java:577)
        at org.netbeans.api.debugger.Properties$PropertiesImpl$ServicesHolder.find(Properties.java:608)
        at org.netbeans.api.debugger.Properties$PropertiesImpl.getInitialValue(Properties.java:696)
        at org.netbeans.api.debugger.Properties$PropertiesImpl.getArray(Properties.java:993)
Comment 17 esmithbss 2009-03-12 07:04:42 UTC
Created attachment 78097 [details]
stacktrace
Comment 18 Vladimir Voskresensky 2009-03-12 11:27:07 UTC
http://statistics.netbeans.org/exceptions/detail.do?id=146918
it has already >50 duplicates and should be treated as P1
http://wiki.netbeans.org/BugPriorityGuidelines
Comment 19 Martin Entlicher 2009-03-13 13:29:49 UTC
After debugging this problem for several hours, I've found that ergonomics is somehow duplicating generated layers. And
it creates mistakes in this duplication!

The problematic file is "ide.ergonomics/build/classes/org/netbeans/modules/ide/ergonomics/java/layer.xml"
Which contains:
<folder name="Debugger"><file name="org-netbeans-modules-debugger-jpda-ui-options-OptionsInitializer.instance">
            <attr name="serviceName" stringvalue="org.netbeans.modules.debugger.jpda.ui.options.OptionsInitializer"/>
            <attr name="instanceOf" stringvalue="org.netbeans.api.debugger.Properties$Initializer"/>
            <attr name="instanceCreate" methodvalue="org.netbeans.modules.ide.ergonomics.debugger.AttachTypeProxy.create"/>
        </file>

This is causing the problems.
Comment 20 Vladimir Voskresensky 2009-03-13 13:39:42 UTC
I can confirm that disabling ergonomic cluster eleminate the problem
Comment 21 Jaroslav Tulach 2009-03-13 16:41:06 UTC
ergonomics#b70b78c72c9e
Comment 22 Jaroslav Tulach 2009-03-13 16:50:28 UTC
I wish I could take away your pain. However I have not suspected it is registration error. If I got 
ClassCastException, I would investigate more deeply, but the NPE looked like something completely unrelated to what we 
do. Sorry. I have at least improved our code to fail more quickly with at least decent identification of the problem 
in future: ergonomics#4b29ea29328f
Comment 23 Quality Engineering 2009-03-17 08:30:04 UTC
Integrated into 'main-golden', will be available in build *200903170201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/4b29ea29328f
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #159608: Throwing exception when the fileobject seems to be misconfigured