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 253987 - ClassCastException: java.lang.String cannot be cast to org.json.simple.JSONObject
Summary: ClassCastException: java.lang.String cannot be cast to org.json.simple.JSONOb...
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Libraries (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Jan Stola
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-30 11:12 UTC by thruminds
Modified: 2015-07-31 12:42 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 218856


Attachments
stacktrace (8.46 KB, text/plain)
2015-07-30 11:12 UTC, thruminds
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thruminds 2015-07-30 11:12:14 UTC
Build: NetBeans IDE 8.1 Beta (Build 201507282201)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.60-b23, Java(TM) SE Runtime Environment, 1.8.0_60-ea-b24
OS: Windows 7

User Comments:
GUEST: Project > Properties > Javascript Libraries > CDNJS > Search = ERROR!

thruminds: Project properties -> JavaScript Libraries -> CDNJS -> Add -> type angular in the 'find' text box -> hit search




Stacktrace: 
java.lang.ClassCastException: java.lang.String cannot be cast to org.json.simple.JSONObject
   at org.netbeans.modules.javascript.cdnjs.LibraryProvider$SearchTask.createVersion(LibraryProvider.java:418)
   at org.netbeans.modules.javascript.cdnjs.LibraryProvider$SearchTask.createLibrary(LibraryProvider.java:376)
   at org.netbeans.modules.javascript.cdnjs.LibraryProvider$SearchTask.parse(LibraryProvider.java:331)
   at org.netbeans.modules.javascript.cdnjs.LibraryProvider$SearchTask.run(LibraryProvider.java:283)
   at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
   at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
Comment 1 thruminds 2015-07-30 11:12:16 UTC
Created attachment 155050 [details]
stacktrace
Comment 2 Jan Stola 2015-07-30 13:15:29 UTC
It seems that the CDNJS server returns the data in a different format than it used to return them.

I have modified the corresponding code to handle both cases (the old and the current format).

Modified file: https://hg.netbeans.org/web-main/rev/f028b440d36c
Comment 3 Jan Stola 2015-07-30 13:39:39 UTC
Integrated into release81_beta branch:
https://hg.netbeans.org/releases/rev/02fb055cdd47
https://hg.netbeans.org/releases/rev/dec4b27736a3
Comment 4 Quality Engineering 2015-07-31 01:51:13 UTC
Integrated into 'main-silver', will be available in build *201507310002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f028b440d36c
User: Jan Stola <jstola@netbeans.org>
Log: #253987: ClassCastException: java.lang.String cannot be cast to org.json.simple.JSONObject
Comment 5 Vladimir Riha 2015-07-31 12:42:49 UTC
Verified in Beta, thank you

Product Version: NetBeans IDE 8.1 Beta (Build 201507302201)
Java: 1.8.0_51; Java HotSpot(TM) 64-Bit Server VM 25.51-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_51-b16
System: Linux version 3.16.0-30-generic running on amd64; UTF-8; en_US (nb)