javax.script.ScriptException: ReferenceError: "HttpResponseStatus" is not defined in <eval> at line number 1

GitHub | Balinski | 3 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Bluebird in JDK Nashorn

    GitHub | 2 years ago | akovari
    javax.script.ScriptException: TypeError: Cannot set property "Promise" of undefined in <eval> at line number 29
  2. 0

    global-scope fields not accessible from within engine-scope methods

    Stack Overflow | 2 years ago | bvdb
    javax.script.ScriptException: ReferenceError: "wrapper" is not defined in <eval> at line number 7
  3. 0

    FULL PRODUCT VERSION : java version "1.8.0-ea" Java(TM) SE Runtime Environment (build 1.8.0-ea-b106) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b48, mixed mode) ADDITIONAL OS VERSION INFORMATION : Microsoft Windows [Version 6.1.7601] A DESCRIPTION OF THE PROBLEM : New scripting engine introduced in Java 8 no longer seems to handle importClass or importPackage built-in functions. When referenced in a scripting, it throws javax.script.ScriptException: ReferenceError: "importClass" is not defined in <eval> at line number ... REGRESSION. Last worked in version 7u21 STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Run the source code specified in this bug report ERROR MESSAGES/STACK TRACES THAT OCCUR : SEVERE: null javax.script.ScriptException: ReferenceError: "importClass" is not defined in <eval> at line number 1 at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:553) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:537) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:517) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:513) at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:202) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264) at java8scripting.Java8Scripting.main(Java8Scripting.java:15) Caused by: <eval>:1 ReferenceError: "importClass" is not defined at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57) at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319) at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291) at jdk.nashorn.api.scripting.NashornScriptEngine.__noSuchProperty__(NashornScriptEngine.java:286) at jdk.nashorn.internal.scripts.Script$engine._L35(nashorn:engine/resources/engine.js:37) at jdk.nashorn.internal.scripts.Script$\^eval\_.runScript(<eval>:1) at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:527) at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:204) at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:395) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:535) ... 5 more REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- package java8scripting; import java.util.logging.Level; import java.util.logging.Logger; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; public class Java8Scripting { public static void main(String[] args) { try { ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript") ; engine.eval("importClass(java.util.Vector) " + "print(\"Hello world\") ;"); } catch (Exception ex) { Logger.getLogger(Java8Scripting.class.getName()).log(Level.SEVERE, null, ex); } } } ---------- END SOURCE ----------

    JDK Bug System | 4 years ago | Nelson Dcosta
    javax.script.ScriptException: ReferenceError: "importClass" is not defined in <eval> at line number 1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    FULL PRODUCT VERSION : java version "1.8.0-ea" Java(TM) SE Runtime Environment (build 1.8.0-ea-b106) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b48, mixed mode) ADDITIONAL OS VERSION INFORMATION : Microsoft Windows [Version 6.1.7601] A DESCRIPTION OF THE PROBLEM : New scripting engine introduced in Java 8 no longer seems to handle importClass or importPackage built-in functions. When referenced in a scripting, it throws javax.script.ScriptException: ReferenceError: "importClass" is not defined in <eval> at line number ... REGRESSION. Last worked in version 7u21 STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Run the source code specified in this bug report ERROR MESSAGES/STACK TRACES THAT OCCUR : SEVERE: null javax.script.ScriptException: ReferenceError: "importClass" is not defined in <eval> at line number 1 at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:553) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:537) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:517) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:513) at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:202) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264) at java8scripting.Java8Scripting.main(Java8Scripting.java:15) Caused by: <eval>:1 ReferenceError: "importClass" is not defined at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57) at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319) at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291) at jdk.nashorn.api.scripting.NashornScriptEngine.__noSuchProperty__(NashornScriptEngine.java:286) at jdk.nashorn.internal.scripts.Script$engine._L35(nashorn:engine/resources/engine.js:37) at jdk.nashorn.internal.scripts.Script$\^eval\_.runScript(<eval>:1) at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:527) at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:204) at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:395) at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:535) ... 5 more REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- package java8scripting; import java.util.logging.Level; import java.util.logging.Logger; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; public class Java8Scripting { public static void main(String[] args) { try { ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript") ; engine.eval("importClass(java.util.Vector) " + "print(\"Hello world\") ;"); } catch (Exception ex) { Logger.getLogger(Java8Scripting.class.getName()).log(Level.SEVERE, null, ex); } } } ---------- END SOURCE ----------

    JDK Bug System | 4 years ago | Nelson Dcosta
    javax.script.ScriptException: ReferenceError: "importClass" is not defined in <eval> at line number 1
  6. 0

    Can I use Firebase web client scripts using Java Nashorn?

    Stack Overflow | 5 months ago | jpx
    javax.script.ScriptException: ReferenceError: "global" is not defined in https://www.gstatic.com/firebasejs/3.5.2/firebase-app.js at line number 14

  1. SteVio1989 1 times, last 3 months ago
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. jdk.nashorn.internal.runtime.ECMAException

    ReferenceError: "HttpResponseStatus" is not defined

    at jdk.nashorn.internal.runtime.ECMAErrors.error()
  2. jdk.nashorn.internal
    Global.__noSuchProperty__
    1. jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)[nashorn.jar:?]
    2. jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)[nashorn.jar:?]
    3. jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291)[nashorn.jar:?]
    4. jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1426)[nashorn.jar:?]
    4 frames