You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jean-Baptiste Defard (Jira)" <ji...@apache.org> on 2020/01/10 07:50:00 UTC

[jira] [Updated] (CAMEL-14387) Null pointer exception when restart client in SubscriptionHelper

     [ https://issues.apache.org/jira/browse/CAMEL-14387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Defard updated CAMEL-14387:
-----------------------------------------

I have created a PR :

https://github.com/apache/camel/pull/3473

> Null pointer exception when restart client in SubscriptionHelper
> ----------------------------------------------------------------
>
>                 Key: CAMEL-14387
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14387
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-salesforce
>    Affects Versions: 3.0.0.RC3, 3.0.0
>            Reporter: Jean-Baptiste Defard
>            Priority: Critical
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)