Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-4376

Resource exception when change an imported groovy script

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: OpenIDM 3.1.0, OpenIDM 3.1.1, OpenIDM 4.0.0
    • Fix Version/s: OpenIDM 3.1.0
    • Component/s: Module - Scripting
    • Labels:
    • Sprint:
      IDM Sustaining Sprint 1
    • Cases:
    • Support Ticket IDs:

      Description

      If an endpoint groovy script invokes an imported groovy script, and the endpoint and imported scripts are changed at the same time more than once, a resource exception will occur. The repro steps are:
      1. Copy endpoint-echo.json to conf and echo.groovy to script.
      2. Create a new groovy script (attached) and copy to lib. Import this script into echo.groovy.
      3. Start openidm.
      4. Change both scripts and call the endpoint. The changes to both scripts will be picked up.
      5. Change both scripts again and call the endpoint.

      Expected Results: The changes to both scripts should be picked up as before.

      Actual Results: The endpoint call fails with:
      {
      "code": 500,
      "reason": "Internal Server Error",
      "message": "groovy.util.ResourceException: No resource for file:/Users/forgerock/@WORKSPACE/INSTANCE/9611-endpoint_script/lib/Main.groovy was found",
      "detail":

      { "fileName": null, "lineNumber": -1, "columnNumber": -1 }

      }

      The stack trace in the openidm log is pasted below. If you restart openidm the script changes are picked up as expected.

      Some additional tests run were:
      Change the endpoint script -> change is always picked up
      Change the imported script -> change is not picked up until restart
      Change both the endpoint script and import script once -> change to both the endpoint and imported script is picked up
      Change both the endpoint script and import script a second time -> endpoint call fails with "Resource exception

      ----------------------------
      WARNING: Resource exception: 500 Internal Server Error: "groovy.util.ResourceException: No resource for file:/Users/forgerock/@My_test_environments/master/lib/Main.groovy was found"
      org.forgerock.json.resource.InternalServerErrorException: groovy.util.ResourceException: No resource for file:/Users/forgerock/@My_test_environments/master/lib/Main.groovy was found
      at org.forgerock.openidm.script.ScriptedRequestHandler.convertScriptException(ScriptedRequestHandler.java:399)
      at org.forgerock.openidm.script.ScriptedRequestHandler.handleRead(ScriptedRequestHandler.java:364)
      at org.forgerock.json.resource.Router.handleRead(Router.java:324)
      at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:109)
      at org.forgerock.json.resource.Filters$ConditionalFilter.filterRead(Filters.java:102)
      at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:107)
      at org.forgerock.json.resource.Filters$ConditionalFilter.filterRead(Filters.java:102)
      at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:107)
      at org.forgerock.openidm.servlet.internal.ScriptedFilter$5.apply(ScriptedFilter.java:132)
      at org.forgerock.openidm.servlet.internal.ScriptedFilter$5.apply(ScriptedFilter.java:129)
      at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:200)
      at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:184)
      at org.forgerock.openidm.servlet.internal.ScriptedFilter.filterResourceResponseRequest(ScriptedFilter.java:167)
      at org.forgerock.openidm.servlet.internal.ScriptedFilter.filterRead(ScriptedFilter.java:128)
      at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:107)
      at org.forgerock.openidm.audit.filter.AuditFilter.filterRead(AuditFilter.java:162)
      at org.forgerock.json.resource.Filters$ConditionalFilter.filterRead(Filters.java:100)
      at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:107)
      at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$5.filterRead(ServletConnectionFactory.java:522)
      at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:107)
      at org.forgerock.openidm.maintenance.impl.PassthroughFilter.filterRead(PassthroughFilter.java:72)
      at org.forgerock.openidm.maintenance.impl.MaintenanceService.filterRead(MaintenanceService.java:273)
      at org.forgerock.json.resource.Filters$ConditionalFilter.filterRead(Filters.java:100)
      at org.forgerock.json.resource.FilterChain$Cursor.handleRead(FilterChain.java:107)
      at org.forgerock.json.resource.FilterChain.handleRead(FilterChain.java:237)
      at org.forgerock.json.resource.InternalConnection.readAsync(InternalConnection.java:89)
      at org.forgerock.json.resource.AbstractConnectionWrapper.readAsync(AbstractConnectionWrapper.java:207)
      at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$1$1.readAsync(ServletConnectionFactory.java:206)
      at org.forgerock.json.resource.http.RequestRunner.visitReadRequest(RequestRunner.java:316)
      at org.forgerock.json.resource.http.RequestRunner.visitReadRequest(RequestRunner.java:73)
      at org.forgerock.json.resource.Requests$ReadRequestImpl.accept(Requests.java:591)
      at org.forgerock.json.resource.http.RequestRunner.handleResult(RequestRunner.java:119)
      at org.forgerock.json.resource.http.HttpAdapter$2.apply(HttpAdapter.java:566)
      at org.forgerock.json.resource.http.HttpAdapter$2.apply(HttpAdapter.java:563)
      at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:200)
      at org.forgerock.json.resource.http.HttpAdapter.doRequest(HttpAdapter.java:562)
      at org.forgerock.json.resource.http.HttpAdapter.doRead(HttpAdapter.java:256)
      at org.forgerock.json.resource.http.HttpAdapter.handle(HttpAdapter.java:163)
      at org.forgerock.http.handler.Chain.handle(Chain.java:57)
      at org.forgerock.http.filter.OptionsFilter.filter(OptionsFilter.java:77)
      at org.forgerock.http.handler.Chain.handle(Chain.java:55)
      at org.forgerock.http.handler.Chain.handle(Chain.java:57)
      at org.forgerock.caf.authentication.framework.AuthenticationFramework.grantAccess(AuthenticationFramework.java:218)
      at org.forgerock.caf.authentication.framework.AuthenticationFramework.access$400(AuthenticationFramework.java:63)
      at org.forgerock.caf.authentication.framework.AuthenticationFramework$3.apply(AuthenticationFramework.java:210)
      at org.forgerock.caf.authentication.framework.AuthenticationFramework$3.apply(AuthenticationFramework.java:203)
      at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:200)
      at org.forgerock.caf.authentication.framework.AuthenticationFramework.validateRequest(AuthenticationFramework.java:166)
      at org.forgerock.caf.authentication.framework.AuthenticationFramework.access$100(AuthenticationFramework.java:63)
      at org.forgerock.caf.authentication.framework.AuthenticationFramework$1.apply(AuthenticationFramework.java:153)
      at org.forgerock.caf.authentication.framework.AuthenticationFramework$1.apply(AuthenticationFramework.java:150)
      at org.forgerock.util.promise.PromiseImpl$6.handleStateChange(PromiseImpl.java:415)
      at org.forgerock.util.promise.PromiseImpl.handleCompletion(PromiseImpl.java:486)
      at org.forgerock.util.promise.PromiseImpl.addOrFireListener(PromiseImpl.java:474)
      at org.forgerock.util.promise.PromiseImpl.thenAsync(PromiseImpl.java:408)
      at org.forgerock.caf.authentication.framework.AuthenticationFramework.processMessage(AuthenticationFramework.java:144)
      at org.forgerock.caf.authentication.framework.AuthenticationFilter.filter(AuthenticationFilter.java:96)
      at org.forgerock.openidm.auth.AuthFilterWrapper.filter(AuthFilterWrapper.java:90)
      at org.forgerock.http.handler.Chain.handle(Chain.java:55)
      at org.forgerock.http.servlet.HttpFrameworkServlet.service(HttpFrameworkServlet.java:220)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:259)
      <snip>
      Caused by: javax.script.ScriptException: groovy.util.ResourceException: No resource for file:/Users/forgerock/@My_test_environments/master/lib/Main.groovy was found
      at org.forgerock.script.groovy.GroovyScript.eval(GroovyScript.java:242)
      at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.forgerock.script.registry.ScriptRegistryImpl$LibraryRecord.invoke(ScriptRegistryImpl.java:505)
      at com.sun.proxy.$Proxy10.eval(Unknown Source)
      at org.forgerock.script.registry.ScriptRegistryImpl$ScriptImpl.eval(ScriptRegistryImpl.java:741)
      at org.forgerock.script.registry.ScriptRegistryImpl$ScriptImpl.eval(ScriptRegistryImpl.java:752)
      at org.forgerock.openidm.script.ScriptedRequestHandler.evaluate(ScriptedRequestHandler.java:418)
      at org.forgerock.openidm.script.ScriptedRequestHandler.handleRead(ScriptedRequestHandler.java:362)
      ... 99 more

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mark.offutt Mark Offutt [X] (Inactive)
                Reporter:
                nena.hunt Nena Hunt [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: