java.lang.ClassCastException: Cannot cast jdk.nashorn.api.scripting.ScriptObjectMirror to java.util.function.Function

JDK Bug System | Fairoz Matte | 4 months ago
  1. 0

    java 8 - Passing a function through bindings

    Stack Overflow | 6 months ago | MisterErwin
    java.lang.ClassCastException: Cannot cast jdk.nashorn.api.scripting.ScriptObjectMirror to java.util.function.Function
  2. 0

    Found one issue in stackoverflow http://stackoverflow.com/questions/37611959/java-8-passing-a-function-through-bindings JS function declared in the engine scope. Invoking withoutProxy works fine. But withProxy throws java.lang.ClassCastException: == -sh-4.1$ /opt/java/jdk1.8.0_102/bin/java Foo 1.8.0_102 Exception in thread "main" java.lang.ClassCastException: Cannot cast jdk.nashorn.api.scripting.ScriptObjectMirror to java.util.function.Function at java.lang.invoke.MethodHandleImpl.newClassCastException(MethodHandleImpl.java:361) at java.lang.invoke.MethodHandleImpl.castReference(MethodHandleImpl.java:356) at jdk.nashorn.internal.scripts.Script$Recompilation$5$17A$\^eval\_.proxy(<eval>:1) at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:639) at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494) at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:117) at jdk.nashorn.internal.scripts.Script$Recompilation$4$20$\^eval\_.withProxy(<eval>:1) at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637) at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494) at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:199) at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:383) at jdk.nashorn.api.scripting.NashornScriptEngine.invokeFunction(NashornScriptEngine.java:190) at Foo.main(Foo.java:22)

    JDK Bug System | 4 months ago | Fairoz Matte
    java.lang.ClassCastException: Cannot cast jdk.nashorn.api.scripting.ScriptObjectMirror to java.util.function.Function
  3. 0

    Find JMX MBeans using Nashorn javascript jjs

    Stack Overflow | 1 year ago | Mircea Vutcovici
    java.lang.ClassCastException: Cannot cast java.lang.String to javax.management.QueryExp
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Mockito doesn't work well with Robolectric

    GitHub | 7 months ago | floating-cat
    java.lang.ClassCastException: Cannot cast android.widget.TextView$MockitoMock$809592802 to org.robolectric.shadows.ShadowActivity

    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. java.lang.ClassCastException

      Cannot cast jdk.nashorn.api.scripting.ScriptObjectMirror to java.util.function.Function

      at java.lang.invoke.MethodHandleImpl.newClassCastException()
    2. Java RT
      MethodHandleImpl.castReference
      1. java.lang.invoke.MethodHandleImpl.newClassCastException(MethodHandleImpl.java:361)
      2. java.lang.invoke.MethodHandleImpl.castReference(MethodHandleImpl.java:356)
      2 frames