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 102946 - ClassCastException on PaletteItemNode
Summary: ClassCastException on PaletteItemNode
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Palette (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords: REGRESSION
: 93051 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-30 00:23 UTC by _ pcw
Modified: 2008-12-22 11:56 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stack trace (3.28 KB, text/plain)
2007-04-30 00:23 UTC, _ pcw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ pcw 2007-04-30 00:23:21 UTC
I got this trace with a current NB 6 build.  No clue what the trigger was but
I've never seen it before.

java.lang.ClassCastException: org.netbeans.modules.palette.PaletteItemNode
cannot be cast to org.openide.nodes.Node$Cookie
        at org.openide.loaders.XMLDataObject.getCookie(XMLDataObject.java:302)
        at org.openide.loaders.DataNode.getCookie(DataNode.java:397)
        at org.openide.nodes.NodeLookup.addCookie(NodeLookup.java:76)

 ... see attached for the rest
Comment 1 _ pcw 2007-04-30 00:23:42 UTC
Created attachment 41948 [details]
stack trace
Comment 2 Stanislav Aubrecht 2007-05-02 13:52:42 UTC
any steps to reproduce? was it html or form or any other palette? nb version?
jdk version?
Comment 3 Sergey Petrov 2007-05-24 10:29:57 UTC
I'm able to reproduce by following steps from
http://platform.netbeans.org/tutorials/nbm-palette-api3.htm (but on my project
and on new empty module project too)
reproducible with 070523, not reproducible in 5.5

steps:
0. create netbeans module project
next from tutorial, but change folder to folder in your ptoject:
   1. Right-click the project, select New -> File/Folder... Choose XML under
Categories then XML Document under File Types. Click Browse... and select
src/com/example/palette (Click Select Folder). Click Next.
   2. In the Name and Location panel, type simple-item for the File Name. Click
Next.
   3. In the Select Document Type choose DTD-Constrained Document. Click Next.
   4. In the DTD Options, choose from the list for DTD Public ID
-//NetBeans//Editor Palette Item 1.0//EN. Select editor_palette_item for the
Document Root. Click Finish. 

exception is thrown, and is thrown again each time xml node is selected in
project tree, 
generated xml contains 'null' instead of correct link to dtd.

Why the issue is marked for 'future'?
Comment 4 Sergey Petrov 2007-05-24 16:06:50 UTC
Each click, each save each modification with element_node xml followed by
exception, can't open xml after ide restart =>P1
Comment 5 Stanislav Aubrecht 2007-05-25 08:13:56 UTC
fixed

/cvs/core/palette/src/org/netbeans/modules/palette/PaletteItemNode.java,v  <-- 
PaletteItemNode.java
new revision: 1.15; previous revision: 1.14
Comment 6 Sergey Petrov 2007-05-25 13:39:28 UTC
Ok, I don't see ClassCastException any more, but not sure if I should verify the
issue

Still have minor problem with opening: can't open with doubleclick, but can use
context menu Edit now, may be I'll file separate issue later if not yet filed
Comment 7 David Konecny 2007-10-23 15:11:28 UTC
*** Issue 93051 has been marked as a duplicate of this issue. ***