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 245508 - NoSuchMethodException: org.netbeans.core.multiview.ContextAwareDescription.<init>()
Summary: NoSuchMethodException: org.netbeans.core.multiview.ContextAwareDescription.<i...
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Settings (show other bugs)
Version: 8.1
Hardware: All All
: P1 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-09 09:46 UTC by Petr Hejl
Modified: 2014-11-03 09:49 UTC (History)
8 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 210618


Attachments
stacktrace (4.42 KB, text/plain)
2014-07-09 09:46 UTC, Petr Hejl
Details
stacktrace (5.82 KB, text/plain)
2014-10-19 16:22 UTC, Vladimir Riha
Details
stacktrace (4.38 KB, text/plain)
2014-10-20 06:37 UTC, Tomas Mysik
Details
stacktrace (5.82 KB, text/plain)
2014-10-21 08:22 UTC, Ondrej Brejla
Details
stacktrace (3.26 KB, text/plain)
2014-10-21 09:43 UTC, Petr Jiricka
Details
stacktrace (4.53 KB, text/plain)
2014-10-22 13:46 UTC, Jiri Skrivanek
Details
stacktrace (3.11 KB, text/plain)
2014-10-24 06:29 UTC, Martin Fousek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Hejl 2014-07-09 09:46:35 UTC
Build: NetBeans IDE Dev (Build 20140707-1df472e94a0a)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.5-b02, Java(TM) SE Runtime Environment, 1.8.0_05-b13
OS: Linux

User Comments:
phejl: Created JSF project using build from server_split bracnh.




Stacktrace: 
java.lang.NoSuchMethodException: org.netbeans.core.multiview.ContextAwareDescription.<init>()
   at java.lang.Class.getConstructor0(Class.java:2971)
   at java.lang.Class.newInstance(Class.java:403)
   at org.netbeans.modules.editor.mimelookup.impl.FolderPathLookup$InstanceItem.createInstanceFor(FolderPathLookup.java:348)
   at org.netbeans.modules.editor.mimelookup.impl.FolderPathLookup$InstanceItem.getInstance(FolderPathLookup.java:281)
   at org.netbeans.modules.editor.mimelookup.impl.FolderPathLookup$PairItem.getInstance(FolderPathLookup.java:169)
   at org.openide.util.lookup.AbstractLookup$R.allInstances(AbstractLookup.java:1055)
Comment 1 Petr Hejl 2014-07-09 09:46:37 UTC
Created attachment 147949 [details]
stacktrace
Comment 2 Milutin Kristofic 2014-08-12 13:16:41 UTC
Mila, can be this connected with your changes in Task #243042
Comment 3 Vladimir Riha 2014-10-19 16:22:34 UTC
Created attachment 149984 [details]
stacktrace

opened HTML file
Comment 4 Tomas Mysik 2014-10-20 06:37:35 UTC
Created attachment 149989 [details]
stacktrace

created new HTML5 project
Comment 5 Vladimir Riha 2014-10-20 08:12:52 UTC
I think this is more of a P2, seems to pop up on each IDE start (when some projects are opened) and sometimes opened projects disappear from Projects window (although files remain open)
Comment 6 Exceptions Reporter 2014-10-20 11:37:36 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=210618
Comment 7 Ondrej Brejla 2014-10-21 08:22:39 UTC
Created attachment 150015 [details]
stacktrace

Opened html file...
Comment 8 Petr Jiricka 2014-10-21 09:43:39 UTC
Created attachment 150018 [details]
stacktrace

Opening a HTML file.
Comment 9 Jiri Skrivanek 2014-10-22 13:46:54 UTC
Created attachment 150056 [details]
stacktrace

To reproduce create web project with GlassFish server.
Comment 10 Exceptions Reporter 2014-10-22 13:46:58 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=210618
Comment 11 Martin Fousek 2014-10-24 06:29:05 UTC
Created attachment 150097 [details]
stacktrace

Switched between project groups to another one where is opened JS file
Comment 12 Miloslav Metelka 2014-10-30 09:19:36 UTC
The problem is that org.netbeans.modules.web.browser.ui.HtmlPreviewElement.createMultiViewDescription()
declared for "instanceCreate" attribute in layer.xml for web.browser.api module returns null and so the code in FolderPathLookup defaults to an attempt of instantiation of an "instanceClass" attribute. However that is an interface ContextAwareDescription. IMHO "instanceOf" attribute should be used instead of "instanceClass" in this particular case so I've modified the layer.

 The javadoc of InstanceCookie.instanceClass() generally says that "instanceClass" should not be used ("instanceOf" should be used instead). But it's return value specification says: "the type (or perhaps some interesting supertype) of the instance". If it can be a supertype as well (of the target class) then the "instanceClass" attribute should never be used as a type for an instantiation attempt. Jardo, is it a correct assumption? Thanks.

http://hg.netbeans.org/jet-main/rev/88c39d6425f5
Comment 13 Quality Engineering 2014-11-01 04:45:41 UTC
Integrated into 'main-silver', will be available in build *201411010002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/88c39d6425f5
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #245508 - NoSuchMethodException: org.netbeans.core.multiview.ContextAwareDescription.<init>().
Comment 14 Jaroslav Tulach 2014-11-03 09:49:08 UTC
(In reply to Miloslav Metelka from comment #12)
> The javadoc of InstanceCookie.instanceClass() generally says that
> "instanceClass" should not be used ("instanceOf" should be used instead).

This is true on the level of Java method. Don't call instanceClass().isAssignableFrom, but rather instanceOf(...).

> But it's return value specification says: "the type (or perhaps some
> interesting supertype) of the instance". If it can be a supertype as well
> (of the target class) then the "instanceClass" attribute should never be
> used as a type for an instantiation attempt.

I don't think so. Since beginning, if instanceClass attribute was specified (and on instanceCreate) that would mean to try to create instance using default constructor of the specified class, at least as far as I rememeber.