Uploaded image for project: 'OpenICF'
  1. OpenICF
  2. OPENICF-989

Salesforce - patch REMOVE throws 500 Error - NullPointerException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: salesforce-connector-1.5.0.0
    • Component/s: Salesforce Connector
    • Labels:
    • Environment:
      OpenIDM 6.5.0-SNAPSHOT (e49343c)
      SalesforceConnector 1.5.0.0-SNAPSHOT (96b2b1e57c4)

      Description

      When trying to do patch remove of attribute or attribute with value, NPE is thrown and request returns 500 Internal Server Error.
      If patch remove is not supported, we should expect UnsupportedOperationException and not NullPointerException

      Reproduce

      curl -H "content-type: application/json" -H "If-Match: *" -H "X-OpenIDM-Username: openidm-admin" -H "X-OpenIDM-Password: openidm-admin" -X  PATCH --data-binary [{"operation": "remove", "field": "/FirstName", "value": "zkvqfhqyjmnqhoz"}] http://forgerock.stack.com:8080/openidm/system/salesforce/User/00529000002rvJjAAI
      
      {"code":500,"reason":"Internal Server Error","message":"Internal Server Error"}
      

      OpenIDM exception

      WARNING: Resource exception: 500 Internal Server Error: "Internal Server Error"
      org.forgerock.json.resource.InternalServerErrorException: Internal Server Error
      	at org.forgerock.openidm.provisioner.openicf.impl.ObjectClassResourceProvider.handlePatch(ObjectClassResourceProvider.java:415)
      	at org.forgerock.openidm.provisioner.openicf.impl.ObjectClassRequestHandler.handlePatch(ObjectClassRequestHandler.java:121)
      	at org.forgerock.json.resource.Router.handlePatch(Router.java:293)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:85)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterPatch(Filters.java:74)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterPatch(Filters.java:72)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterPatch(Filters.java:74)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.lambda$filterPatch$3(DelegatedAdminFilter.java:207)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:260)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:224)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.filterRequest(DelegatedAdminFilter.java:261)
      	at org.forgerock.openidm.authz.DelegatedAdminFilter.filterPatch(DelegatedAdminFilter.java:207)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterPatch(Filters.java:72)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.openidm.audit.filter.AuditFilter.lambda$filterPatch$3(AuditFilter.java:137)
      	at org.forgerock.openidm.audit.filter.AuditFilter.logAuditAccessEntry(AuditFilter.java:175)
      	at org.forgerock.openidm.audit.filter.AuditFilter.filterPatch(AuditFilter.java:137)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterPatch(MutableFilterDecorator.java:84)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterPatch(Filters.java:72)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.lambda$filterPatch$3(ServletConnectionFactory.java:397)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.handleRequestWithLogging(ServletConnectionFactory.java:436)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$3.filterPatch(ServletConnectionFactory.java:397)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.openidm.router.filter.PassthroughFilter.filterPatch(PassthroughFilter.java:60)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterPatch(MutableFilterDecorator.java:84)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterPatch(MutableFilterDecorator.java:84)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.openidm.router.filter.PassthroughFilter.filterPatch(PassthroughFilter.java:60)
      	at org.forgerock.openidm.router.filter.MutableFilterDecorator.filterPatch(MutableFilterDecorator.java:84)
      	at org.forgerock.json.resource.Filters$ConditionalFilter.filterPatch(Filters.java:72)
      	at org.forgerock.json.resource.FilterChain$Cursor.handlePatch(FilterChain.java:83)
      	at org.forgerock.json.resource.FilterChain.handlePatch(FilterChain.java:244)
      	at org.forgerock.json.resource.InternalConnection.patchAsync(InternalConnection.java:66)
      	at org.forgerock.json.resource.AbstractConnectionWrapper.patchAsync(AbstractConnectionWrapper.java:155)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.lambda$patchAsync$9(ServletConnectionFactory.java:346)
      	at org.forgerock.openidm.metrics.MetricsCollector.time(MetricsCollector.java:112)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.time(ServletConnectionFactory.java:292)
      	at org.forgerock.openidm.servlet.internal.ServletConnectionFactory$InternalConnectionWrapper.patchAsync(ServletConnectionFactory.java:346)
      	at org.forgerock.json.resource.http.RequestRunner.visitPatchRequest(RequestRunner.java:209)
      	at org.forgerock.json.resource.http.RequestRunner.visitPatchRequest(RequestRunner.java:82)
      	at org.forgerock.json.resource.Requests$PatchRequestImpl.accept(Requests.java:362)
      	at org.forgerock.json.resource.http.RequestRunner.handleResult(RequestRunner.java:128)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:260)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:249)
      	at org.forgerock.json.resource.http.HttpAdapter.doRequest(HttpAdapter.java:713)
      	at org.forgerock.json.resource.http.HttpAdapter.doPatch(HttpAdapter.java:510)
      	at org.forgerock.json.resource.http.HttpAdapter.handle(HttpAdapter.java:279)
      	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.routing.Router.handle(Router.java:100)
      	at org.forgerock.http.swagger.OpenApiRequestFilter.filter(OpenApiRequestFilter.java:63)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.openidm.auth.ProfileEnhancementCheckFilter.filter(ProfileEnhancementCheckFilter.java:148)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.openidm.auth.LoginCountFilter.filter(LoginCountFilter.java:63)
      	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:260)
      	at org.forgerock.util.promise.Promises$CompletedPromise.thenAsync(Promises.java:249)
      	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:87)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.http.filter.TransactionIdInboundFilter.filter(TransactionIdInboundFilter.java:86)
      	at org.forgerock.http.handler.Handlers$1.handle(Handlers.java:53)
      	at org.forgerock.http.servlet.HttpFrameworkServlet.service(HttpFrameworkServlet.java:252)
      	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.CrossOriginFilter.handle(CrossOriginFilter.java:257)
      	at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:220)
      	at sun.reflect.GeneratedMethodAccessor96.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:309)
      	at com.sun.proxy.$Proxy67.doFilter(Unknown Source)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83)
      	at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:301)
      	at sun.reflect.GeneratedMethodAccessor96.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:309)
      	at com.sun.proxy.$Proxy67.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: java.lang.NullPointerException
      	at org.forgerock.openicf.connectors.salesforce.resource.SalesforceResource.setResourceAttributes(SalesforceResource.java:156)
      	at org.forgerock.openicf.connectors.salesforce.SalesforceConnector.update(SalesforceConnector.java:136)
      	at org.identityconnectors.framework.impl.api.local.operations.UpdateImpl.removeAttributeValues(UpdateImpl.java:137)
      	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.identityconnectors.framework.impl.api.local.operations.ConnectorAPIOperationRunnerProxy.invoke(ConnectorAPIOperationRunnerProxy.java:104)
      	at com.sun.proxy.$Proxy73.removeAttributeValues(Unknown Source)
      	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.identityconnectors.framework.impl.api.local.operations.ThreadClassLoaderManagerProxy.invoke(ThreadClassLoaderManagerProxy.java:96)
      	at com.sun.proxy.$Proxy73.removeAttributeValues(Unknown Source)
      	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.identityconnectors.framework.impl.api.DelegatingTimeoutProxy.invoke(DelegatingTimeoutProxy.java:98)
      	at com.sun.proxy.$Proxy73.removeAttributeValues(Unknown Source)
      	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.identityconnectors.framework.impl.api.local.LocalConnectorFacadeImpl$ReferenceCountingProxy.invoke(LocalConnectorFacadeImpl.java:304)
      	at com.sun.proxy.$Proxy73.removeAttributeValues(Unknown Source)
      	at org.identityconnectors.framework.impl.api.AbstractConnectorFacade.removeAttributeValues(AbstractConnectorFacade.java:274)
      	at org.forgerock.openidm.provisioner.openicf.impl.ObjectClassResourceProvider.executePatchOperations(ObjectClassResourceProvider.java:732)
      	at org.forgerock.openidm.provisioner.openicf.impl.ObjectClassResourceProvider.handlePatch(ObjectClassResourceProvider.java:397)
      	... 110 more
      

        Attachments

          Activity

            People

            • Assignee:
              emanuel.brici Emanuel Brici
              Reporter:
              michal.orlik@profiq.cz Michal Orlik
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: