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 268791 - javax.script.ScriptException: ReferenceError: "println" is not defined in at line number 1030
Summary: javax.script.ScriptException: ReferenceError: "println" is not defined in at ...
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords: JDK_8, JDK_9, VISUALVM
Depends on:
Blocks:
 
Reported: 2016-11-02 14:53 UTC by Tomas Hurka
Modified: 2017-02-01 08:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Hurka 2016-11-02 14:53:03 UTC
Reported against VisualVM <https://github.com/visualvm/visualvm.src/issues/4>:

I'm trying to analyze a large heap dump (file is around 60GB) using VisualVM 1.3.9. There are a large number of int[] instances consuming the vast majority of the heap space, and I am trying to get to the bottom of why. However, when I click on one of the instances in the instance view, which starts to determine the referrers, it makes it about 2% through and then throws a NullPointerException (as seen in the error button hover).

If I navigate to the OQL window and try it that way via referrers(heap.findObject("0x7fa8fb109ae0")), it runs for a while before printing:

javax.script.ScriptException: ReferenceError: "println" is not defined in at line number 1030

Any ideas on what the problem could be or how I could diagnose further? I am using Sun JDK 1.8.0_60 on Mac OS X, VisualVM 1.3.9.
Comment 1 Tomas Hurka 2016-11-02 14:55:12 UTC
This JDK 8+ bug. Nashorn does not have 'println' in global scope. See https://bugs.openjdk.java.net/browse/JDK-8035181
Comment 2 Tomas Hurka 2016-11-02 15:06:42 UTC
Fixed in profiler-main

changeset:   301479:c9139cd90195
user:        Tomas Hurka <thurka@netbeans.org>
date:        Wed Nov 02 16:05:36 2016 +0100
summary:     bugfix #268791, Nashorn does not have println in global context - use print instead
Comment 3 Quality Engineering 2016-11-04 03:02:30 UTC
Integrated into 'main-silver', will be available in build *201611040002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c9139cd90195
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #268791, Nashorn does not have println in global context - use print instead