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

IllegalArgumentException when specifying a conditional filter on property mapping

    XMLWordPrintable

Details

    Description

      Using samples/sync-with-ldap.

      1. Edit Admin UI > Configure > Mappings > systemLdapAccounts_managedUser;
      2. Edit the "description" property ;
      3. Click on "Conditional Updates" tab > Script;
      4. Add any valid inline javascript and attempt to save;
      5. Get error dialog "Invalid Condition Filter";

      The following exception occurs on save; 

      Mar 19, 2018 10:15:19 AM org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3 lambda$handleRequestWithLogging$8
      WARNING: Resource exception: 500 Internal Server Error: "Wrapped java.lang.IllegalArgumentException: Invalid query filter 'org.forgerock.util.LazyMap@ff61ad48'"
      org.forgerock.json.resource.InternalServerErrorException: Wrapped java.lang.IllegalArgumentException: Invalid query filter 'org.forgerock.util.LazyMap@ff61ad48'
       at org.forgerock.json.resource.ResourceException.newResourceException(ResourceException.java:231)
       at org.forgerock.openidm.script.exception.ScriptThrownException.toResourceException(ScriptThrownException.java:115)
       at org.forgerock.openidm.script.impl.ScriptRegistryService.handleAction(ScriptRegistryService.java:735)
       at org.forgerock.json.resource.Router.handleAction(Router.java:250)
       at org.forgerock.json.resource.FilterChain$Cursor.handleAction(FilterChain.java:55)
       at org.forgerock.json.resource.Filters$ConditionalFilter.filterAction(Filters.java:44)
       at org.forgerock.json.resource.FilterChain$Cursor.handleAction(FilterChain.java:53)
       at org.forgerock.json.resource.Filters$ConditionalFilter.filterAction(Filters.java:44)
       at org.forgerock.json.resource.FilterChain$Cursor.handleAction(FilterChain.java:53)
       at org.forgerock.openidm.filter.ScriptedFilter.lambda$filterAction$0(ScriptedFilter.java:80)
       at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:252)
       at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:216)
       at org.forgerock.openidm.filter.ScriptedFilter.filterRequest(ScriptedFilter.java:142)
       at org.forgerock.openidm.filter.ScriptedFilter.filterAction(ScriptedFilter.java:80)
       at org.forgerock.json.resource.Filters$ConditionalFilter.filterAction(Filters.java:42)
       at org.forgerock.json.resource.FilterChain$Cursor.handleAction(FilterChain.java:53)
       at org.forgerock.openidm.audit.filter.AuditFilter.lambda$filterAction$0(AuditFilter.java:112)
       at org.forgerock.openidm.audit.filter.AuditFilter.logAuditAccessEntry(AuditFilter.java:168)
       at org.forgerock.openidm.audit.filter.AuditFilter.filterAction(AuditFilter.java:112)
       at org.forgerock.openidm.filter.MutableFilterDecorator.filterAction(MutableFilterDecorator.java:66)
       at org.forgerock.json.resource.Filters$ConditionalFilter.filterAction(Filters.java:42)
       at org.forgerock.json.resource.FilterChain$Cursor.handleAction(FilterChain.java:53)
       at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.lambda$filterAction$0(ServletConnectionFactory.java:373)
       at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.handleRequestWithLogging(ServletConnectionFactory.java:430)
       at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.filterAction(ServletConnectionFactory.java:373)
       at org.forgerock.json.resource.FilterChain$Cursor.handleAction(FilterChain.java:53)
       at org.forgerock.openidm.filter.PassthroughFilter.filterAction(PassthroughFilter.java:42)
       at org.forgerock.openidm.filter.MutableFilterDecorator.filterAction(MutableFilterDecorator.java:66)
       at org.forgerock.openidm.filter.MutableFilterDecorator.filterAction(MutableFilterDecorator.java:66)
       at org.forgerock.json.resource.FilterChain$Cursor.handleAction(FilterChain.java:53)
       at org.forgerock.openidm.filter.PassthroughFilter.filterAction(PassthroughFilter.java:42)
       at org.forgerock.openidm.filter.MutableFilterDecorator.filterAction(MutableFilterDecorator.java:66)
       at org.forgerock.json.resource.Filters$ConditionalFilter.filterAction(Filters.java:42)
       at org.forgerock.json.resource.FilterChain$Cursor.handleAction(FilterChain.java:53)
       at org.forgerock.json.resource.FilterChain.handleAction(FilterChain.java:222)
       at org.forgerock.json.resource.InternalConnection.actionAsync(InternalConnection.java:29)
       at org.forgerock.json.resource.AbstractConnectionWrapper.actionAsync(AbstractConnectionWrapper.java:74)
       at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$2$1.actionAsync(ServletConnectionFactory.java:335)
       at org.forgerock.json.resource.http.RequestRunner.visitActionRequest(RequestRunner.java:136)
       at org.forgerock.json.resource.http.RequestRunner.visitActionRequest(RequestRunner.java:82)
       at org.forgerock.json.resource.Requests$ActionRequestImpl.accept(Requests.java:177)
       at org.forgerock.json.resource.http.RequestRunner.handleResult(RequestRunner.java:128)
       at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:252)
       at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:241)
       at org.forgerock.json.resource.http.HttpAdapter.doRequest(HttpAdapter.java:712)
       at org.forgerock.json.resource.http.HttpAdapter.doAction(HttpAdapter.java:618)
       at org.forgerock.json.resource.http.HttpAdapter.handle(HttpAdapter.java:282)
       at org.forgerock.http.handler.Handlers$HandlerDescribableAsDescribableHandler.handle(Handlers.java:146)
       at org.forgerock.http.filter.OptionsFilter.filter(OptionsFilter.java:69)
       at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
       at org.forgerock.http.swagger.OpenApiRequestFilter.filter(OpenApiRequestFilter.java:62)
       at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
       at org.forgerock.caf.authentication.framework.AuthenticationFramework.grantAccess(AuthenticationFramework.java:188)
       at org.forgerock.caf.authentication.framework.AuthenticationFramework.lambda$onValidateRequestSuccess$1(AuthenticationFramework.java:181)
       at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:252)
       at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:241)
       at org.forgerock.caf.authentication.framework.AuthenticationFramework.validateRequest(AuthenticationFramework.java:144)
       at org.forgerock.caf.authentication.framework.AuthenticationFramework.processMessage(AuthenticationFramework.java:134)
       at org.forgerock.caf.authentication.framework.AuthenticationFilter.filter(AuthenticationFilter.java:84)
       at org.forgerock.openidm.auth.AuthFilterWrapper.filter(AuthFilterWrapper.java:82)
       at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
       at org.forgerock.http.filter.TransactionIdInboundFilter.filter(TransactionIdInboundFilter.java:75)
       at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
       at org.forgerock.http.servlet.HttpFrameworkServlet.service(HttpFrameworkServlet.java:258)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
       at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
       at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
       at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83)
       at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:301)
       at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.forgerock.openidm.servletregistration.impl.ServletRegistrationSingleton$FilterProxy.invoke(ServletRegistrationSingleton.java:294)
       at com.sun.proxy.$Proxy57.doFilter(Unknown Source)
       at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
       at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:257)
       at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:220)
       at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.forgerock.openidm.servletregistration.impl.ServletRegistrationSingleton$FilterProxy.invoke(ServletRegistrationSingleton.java:294)
       at com.sun.proxy.$Proxy57.doFilter(Unknown Source)
       at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
       at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
       at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
       at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
       at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
       at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
       at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
       at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:276)
       at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
       at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
       at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
       at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
       at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
       at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
       at org.eclipse.jetty.server.Server.handle(Server.java:499)
       at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
       at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
       at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
       at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
       at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
       at java.lang.Thread.run(Thread.java:748)
      Caused by: org.forgerock.openidm.script.exception.ScriptThrownException: Wrapped java.lang.IllegalArgumentException: Invalid query filter 'org.forgerock.util.LazyMap@ff61ad48' java.lang.IllegalArgumentException: Invalid query filter 'org.forgerock.util.LazyMap@ff61ad48'
       at org.forgerock.openidm.script.javascript.RhinoScriptEngine$3.newScriptThrownException(RhinoScriptEngine.java:419)
       at org.forgerock.openidm.script.javascript.RhinoScript.eval(RhinoScript.java:304)
       at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.forgerock.openidm.script.registry.ScriptRegistryImpl$LibraryRecord.invoke(ScriptRegistryImpl.java:498)
       at com.sun.proxy.$Proxy46.eval(Unknown Source)
       at org.forgerock.openidm.script.registry.ScriptRegistryImpl$ScriptImpl.eval(ScriptRegistryImpl.java:768)
       at org.forgerock.openidm.script.impl.ScriptRegistryService.handleAction(ScriptRegistryService.java:723)
       ... 100 more
      Caused by: java.lang.IllegalArgumentException: Invalid query filter 'org.forgerock.util.LazyMap@ff61ad48'
       at org.forgerock.util.query.QueryFilterParser.valueOfIllegalArgument(QueryFilterParser.java:122)
       at org.forgerock.util.query.QueryFilterParser.valueOfPrimaryExpr(QueryFilterParser.java:177)
       at org.forgerock.util.query.QueryFilterParser.valueOfNotExpr(QueryFilterParser.java:132)
       at org.forgerock.util.query.QueryFilterParser.valueOfAndExpr(QueryFilterParser.java:105)
       at org.forgerock.util.query.QueryFilterParser.valueOfOrExpr(QueryFilterParser.java:138)
       at org.forgerock.util.query.QueryFilterParser.valueOf(QueryFilterParser.java:87)
       at org.forgerock.json.resource.QueryFilters.parse(QueryFilters.java:37)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
       at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
       at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
       at org.mozilla.javascript.gen.CE86F1715AD9073FA7F6D5527F450121DD7F631F_67._c_script_0(CE86F1715AD9073FA7F6D5527F450121DD7F631F:1)
       at org.mozilla.javascript.gen.CE86F1715AD9073FA7F6D5527F450121DD7F631F_67.call(CE86F1715AD9073FA7F6D5527F450121DD7F631F)
       at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
       at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
       at org.mozilla.javascript.gen.CE86F1715AD9073FA7F6D5527F450121DD7F631F_67.call(CE86F1715AD9073FA7F6D5527F450121DD7F631F)
       at org.mozilla.javascript.gen.CE86F1715AD9073FA7F6D5527F450121DD7F631F_67.exec(CE86F1715AD9073FA7F6D5527F450121DD7F631F)
       at org.forgerock.openidm.script.javascript.RhinoScript.eval(RhinoScript.java:289)
       ... 107 more
      
       

      Attachments

        Issue Links

          Activity

            People

              mark.offutt Mark Offutt [X] (Inactive)
              mark.offutt Mark Offutt [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: