Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14387

camel-salesforce - Null pointer exception when restart client in SubscriptionHelper

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0.RC3, 3.0.0
    • Fix Version/s: 3.1.0
    • Component/s: camel-salesforce
    • Labels:
      None
    • Estimated Complexity:
      Moderate

      Description

      When attempt to restart Cometd client, the component throw NPE:

      2019-11-21 13:11:47.200 INFO 1 — [SalesforceHttpClient@3991fe6d-14724] o.a.c.c.s.i.s.SubscriptionHelper : Restarting on unexpected disconnect from Salesforce...
      2019-11-21 13:11:47.200 DEBUG 1 — [SalesforceHttpClient@3991fe6d-14724] o.a.c.c.s.i.s.SubscriptionHelper : Waiting to disconnect...
      2019-11-21 13:11:52.201 DEBUG 1 — [SalesforceHttpClient@3991fe6d-14724] o.a.c.c.s.i.s.SubscriptionHelper : Pausing for 0 msecs before restart attempt
      2019-11-21 13:11:52.201 INFO 1 — [SalesforceHttpClient@3991fe6d-14724] o.a.c.c.s.internal.SalesforceSession : Login at Salesforce loginUrl: https://login.salesforce.com/services/oauth2/token
      2019-11-21 13:11:52.328 ERROR 1 — [SalesforceHttpClient@3991fe6d-14724] o.a.c.c.s.i.s.SubscriptionHelper : Error restarting: {errors:[

      {"errorCode":"unknown_error","message":"Login error code:[unknown_error] description:[retry your request]","fields":null}

      ],statusCode:400}

      org.apache.camel.component.salesforce.api.SalesforceException: {errors:[

      {"errorCode":"unknown_error","message":"Login error code:[unknown_error] description:[retry your request]","fields":null}

      ],statusCode:400}
      at org.apache.camel.component.salesforce.internal.SalesforceSession.parseLoginResponse(SalesforceSession.java:279) ~[camel-salesforce-3.0.0-RC3.jar:3.0.0-RC3]
      at org.apache.camel.component.salesforce.internal.SalesforceSession.login(SalesforceSession.java:130) ~[camel-salesforce-3.0.0-RC3.jar:3.0.0-RC3]
      at org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper.createClient(SubscriptionHelper.java:353) ~[camel-salesforce-3.0.0-RC3.jar:3.0.0-RC3]
      at org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper.doStart(SubscriptionHelper.java:112) ~[camel-salesforce-3.0.0-RC3.jar:3.0.0-RC3]
      at org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper$4.run(SubscriptionHelper.java:277) ~[camel-salesforce-3.0.0-RC3.jar:3.0.0-RC3]
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806) ~[jetty-util-9.4.22.v20191022.jar:9.4.22.v20191022]
      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938) ~[jetty-util-9.4.22.v20191022.jar:9.4.22.v20191022]
      at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

      2019-11-21 13:11:52.331 WARN 1 — [SalesforceHttpClient@3991fe6d-14724] o.e.jetty.util.thread.QueuedThreadPool :

      java.lang.NullPointerException: null
      at org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper$4.run(SubscriptionHelper.java:284) ~[camel-salesforce-3.0.0-RC3.jar:3.0.0-RC3]
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806) ~[jetty-util-9.4.22.v20191022.jar:9.4.22.v20191022]
      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938) ~[jetty-util-9.4.22.v20191022.jar:9.4.22.v20191022]
      at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

       

      When restart in restartClient the client instance is null and (line 284)

      if (client.isHandshook()) {
          LOG.info("Successfully restarted!");

      raise NPE.

      probably the patch:

      if (client != null && client.isHandshook()) { ....

      fix this.

       

      When error occur Salesforce subscription never restart. We must restart services.

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jbdefard Jean-Baptiste Defard
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m