org.forgerock.openig.handler.HandlerException: Script failed unexpectedly

ForgeRock JIRA | Jean-Charles Deville | 2 years ago
  1. 0

    Having this code in my json route file : {code} { "condition": "${matches(exchange.request.uri.path, '^/exception_filter_catch_exception')}", "handler": { "config": { "source": "throw new Exception('Boo!')", "type": "application/x-groovy" }, "type": "ScriptableHandler" } } {code} The expected error is : {Caused by: javax.script.ScriptException: java.lang.Exception: Boo!} But I get the following error : {code} TUE MAR 17 06:30:22 GMT 2015 INFO {Router}/handler --- Modified route 'exception_filter.json' defined in file 'C:\jenkins\workspace\OpenIG-Tests-Trunk\OpenIG-Trunk-Robot-Functional-Tests-Windows-64-bit\results\20150317-013756\Filters\openig\openig-config\config\routes\exception_filter.json' TUE MAR 17 06:30:22 GMT 2015 WARNING {ExceptionFilter}/handler/config/filters/0 --- Script failed unexpectedly # org.forgerock.openig.handler.HandlerException: Script failed unexpectedly # at org.forgerock.openig.script.AbstractScriptableHeapObject.runScript(AbstractScriptableHeapObject.java:203) # at org.forgerock.openig.handler.ScriptableHandler.handle(ScriptableHandler.java:59) # at org.forgerock.openig.handler.DispatchHandler.handle(DispatchHandler.java:88) # at org.forgerock.openig.filter.Chain$1.handle(Chain.java:85) # at org.forgerock.openig.filter.ExceptionFilter.filter(ExceptionFilter.java:56) # at org.forgerock.openig.filter.Chain$1.handle(Chain.java:83) # at org.forgerock.openig.filter.Chain.handle(Chain.java:74) # at org.forgerock.openig.handler.router.Route.handle(Route.java:175) # at org.forgerock.openig.handler.router.RouterHandler.handle(RouterHandler.java:251) # at org.forgerock.openig.audit.decoration.AuditHandler.handle(AuditHandler.java:46) # at org.forgerock.openig.decoration.capture.CaptureHandler.handle(CaptureHandler.java:60) # at org.forgerock.openig.decoration.baseuri.BaseUriHandler.handle(BaseUriHandler.java:55) # at org.forgerock.openig.servlet.GatewayServlet.service(GatewayServlet.java:275) # at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) # at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) # at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) # at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) # at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) # at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) # at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) # at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) # at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) # at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) # at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) # at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) # at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) # at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) # at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) # at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) # at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313) # at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) # at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) # at java.lang.Thread.run(Thread.java:744) # Caused by: javax.script.ScriptException: groovy.util.ResourceException: Malformed URL: file:/C:/jenkins/workspace/OpenIG-Tests-Trunk/OpenIG-Trunk-Robot-Functional-Tests-Windows-64-bit/results/20150317-013756/Filters/openig/openig-config/scripts/groovy, C:\jenkins\workspace\OpenIG-Tests-Trunk\OpenIG-Trunk-Robot-Functional-Tests-Windows-64-bit\results\20150317-013756\Filters\openig\openig-container\apache-tomcat-7.0.53\temp\openig-groovy-script-cache-865643198209743930.tmp\script-2420462090301248169.groovy # at org.forgerock.openig.script.Script$GroovyImpl.run(Script.java:54) # at org.forgerock.openig.script.Script.run(Script.java:237) # at org.forgerock.openig.script.AbstractScriptableHeapObject.runScript(AbstractScriptableHeapObject.java:187) # ... 32 more # Caused by: groovy.util.ResourceException: Malformed URL: file:/C:/jenkins/workspace/OpenIG-Tests-Trunk/OpenIG-Trunk-Robot-Functional-Tests-Windows-64-bit/results/20150317-013756/Filters/openig/openig-config/scripts/groovy, C:\jenkins\workspace\OpenIG-Tests-Trunk\OpenIG-Trunk-Robot-Functional-Tests-Windows-64-bit\results\20150317-013756\Filters\openig\openig-container\apache-tomcat-7.0.53\temp\openig-groovy-script-cache-865643198209743930.tmp\script-2420462090301248169.groovy # at groovy.util.GroovyScriptEngine.getResourceConnection(GroovyScriptEngine.java:388) # at groovy.util.GroovyScriptEngine.loadScriptByName(GroovyScriptEngine.java:530) # at groovy.util.GroovyScriptEngine.createScript(GroovyScriptEngine.java:590) # at groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:577) # at org.forgerock.openig.script.Script$GroovyImpl.run(Script.java:52) # ... 34 more {code} It seems a temporary file is generated but the call to this file doesn't work properly

    ForgeRock JIRA | 2 years ago | Jean-Charles Deville
    org.forgerock.openig.handler.HandlerException: Script failed unexpectedly
  2. 0

    Scripted Fields - Script Runner - Confluence

    atlassian.net | 3 months ago
    groovy.util.ResourceException: Cannot open URL:

    Root Cause Analysis

    1. groovy.util.ResourceException

      Malformed URL: file:/C:/jenkins/workspace/OpenIG-Tests-Trunk/OpenIG-Trunk-Robot-Functional-Tests-Windows-64-bit/results/20150317-013756/Filters/openig/openig-config/scripts/groovy, C:\jenkins\workspace\OpenIG-Tests-Trunk\OpenIG-Trunk-Robot-Functional-Tests-Windows-64-bit\results\20150317-013756\Filters\openig\openig-container\apache-tomcat-7.0.53\temp\openig-groovy-script-cache-865643198209743930.tmp\script-2420462090301248169.groovy

      at groovy.util.GroovyScriptEngine.getResourceConnection()
    2. Groovy
      GroovyScriptEngine.run
      1. groovy.util.GroovyScriptEngine.getResourceConnection(GroovyScriptEngine.java:388)
      2. groovy.util.GroovyScriptEngine.loadScriptByName(GroovyScriptEngine.java:530)
      3. groovy.util.GroovyScriptEngine.createScript(GroovyScriptEngine.java:590)
      4. groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:577)
      4 frames
    3. org.forgerock.openig
      GatewayServlet.service
      1. org.forgerock.openig.script.Script$GroovyImpl.run(Script.java:52)
      2. org.forgerock.openig.script.Script.run(Script.java:237)
      3. org.forgerock.openig.script.AbstractScriptableHeapObject.runScript(AbstractScriptableHeapObject.java:187)
      4. org.forgerock.openig.handler.ScriptableHandler.handle(ScriptableHandler.java:59)
      5. org.forgerock.openig.handler.DispatchHandler.handle(DispatchHandler.java:88)
      6. org.forgerock.openig.filter.Chain$1.handle(Chain.java:85)
      7. org.forgerock.openig.filter.ExceptionFilter.filter(ExceptionFilter.java:56)
      8. org.forgerock.openig.filter.Chain$1.handle(Chain.java:83)
      9. org.forgerock.openig.filter.Chain.handle(Chain.java:74)
      10. org.forgerock.openig.handler.router.Route.handle(Route.java:175)
      11. org.forgerock.openig.handler.router.RouterHandler.handle(RouterHandler.java:251)
      12. org.forgerock.openig.audit.decoration.AuditHandler.handle(AuditHandler.java:46)
      13. org.forgerock.openig.decoration.capture.CaptureHandler.handle(CaptureHandler.java:60)
      14. org.forgerock.openig.decoration.baseuri.BaseUriHandler.handle(BaseUriHandler.java:55)
      15. org.forgerock.openig.servlet.GatewayServlet.service(GatewayServlet.java:275)
      15 frames
    4. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      1 frame
    5. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      2 frames
    6. Tomcat WS
      WsFilter.doFilter
      1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      1 frame
    7. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      8. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      10 frames
    8. Grizzly HTTP
      JIoEndpoint$SocketProcessor.run
      1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
      2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
      3. org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
      3 frames
    9. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      3. java.lang.Thread.run(Thread.java:744)
      3 frames