Uploaded image for project: 'Marketing Automation'
  1. Marketing Automation
  2. MKTAUT-112

Reinitialisation of connection may cause NPE

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Neutral
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.1
    • Labels:

      Description

      Reproduction:

      • With the default configuration, just try to see a task in the system (weird but true)
      • then you will see NPE in the log 

      DEV Hint:

      info.magnolia.mkautomation.MarketingAutomationConnectionProvider#reinitializeAffectedDefinitions is not checking whether the connection is null or not then, therefore, we have NPE.

       

      Case 2 cause NPE:

      • Provider wrong clientSecret in Password app
      • then you will see below NPE in the log 

       

      Caused by: java.lang.NullPointerException
      	at info.magnolia.mkautomation.marketo.client.MarketoClient.generateToken(MarketoClient.java:140) ~[magnolia-marketing-automation-marketo-connector-1.0.1-SNAPSHOT.jar:?]
      	at info.magnolia.mkautomation.client.AbstractClient.createAuthorizationTokenParam(AbstractClient.java:145) ~[magnolia-marketing-automation-1.0.1-SNAPSHOT.jar:?]
      	at info.magnolia.mkautomation.client.AbstractClient.<init>(AbstractClient.java:71) ~[magnolia-marketing-automation-1.0.1-SNAPSHOT.jar:?]
      	at info.magnolia.mkautomation.client.AbstractClient.<init>(AbstractClient.java:62) ~[magnolia-marketing-automation-1.0.1-SNAPSHOT.jar:?]
      	at info.magnolia.mkautomation.marketo.client.MarketoClient.<init>(MarketoClient.java:60) ~[magnolia-marketing-automation-marketo-connector-1.0.1-SNAPSHOT.jar:?]
      	at info.magnolia.mkautomation.marketo.client.MarketoClientProvider.createClient(MarketoClientProvider.java:72) ~[magnolia-marketing-automation-marketo-connector-1.0.1-SNAPSHOT.jar:?]
      	at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2380) ~[caffeine-2.8.1.jar:?]
      	at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853) ~[?:1.8.0_181]
      	at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2378) ~[caffeine-2.8.1.jar:?]
      	at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2361) ~[caffeine-2.8.1.jar:?]
      	at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:108) ~[caffeine-2.8.1.jar:?]
      	at com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62) ~[caffeine-2.8.1.jar:?]
      	at info.magnolia.mkautomation.marketo.client.MarketoClientProvider.createConnection(MarketoClientProvider.java:67) ~[magnolia-marketing-automation-marketo-connector-1.0.1-SNAPSHOT.jar:?]
      	at info.magnolia.mkautomation.marketo.forms.ByName.fetch(ByName.java:59) ~[magnolia-marketing-automation-marketo-connector-1.0.1-SNAPSHOT.jar:?]
      	at info.magnolia.mkautomation.marketo.forms.ByName.fetch(ByName.java:39) ~[magnolia-marketing-automation-marketo-connector-1.0.1-SNAPSHOT.jar:?]
      	at info.magnolia.mkautomation.cache.MarketingFormsCache$ByNameCache.lambda$fetch$0(MarketingFormsCache.java:96) ~[magnolia-marketing-automation-1.0.1-SNAPSHOT.jar:?]
      	at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2380) ~[caffeine-2.8.1.jar:?]
      	at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853) ~[?:1.8.0_181]
      	at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2378) ~[caffeine-2.8.1.jar:?]
      	at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2361) ~[caffeine-2.8.1.jar:?]
      	at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:108) ~[caffeine-2.8.1.jar:?]
      	at com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62) ~[caffeine-2.8.1.jar:?]
      	at info.magnolia.mkautomation.cache.MarketingFormsCache$ByNameCache.fetch(MarketingFormsCache.java:96) ~[magnolia-marketing-automation-1.0.1-SNAPSHOT.jar:?]
      	at info.magnolia.mkautomation.cache.MarketingFormsCache$ByNameCache.fetch(MarketingFormsCache.java:86) ~[magnolia-marketing-automation-1.0.1-SNAPSHOT.jar:?]
      	at info.magnolia.mkautomation.MarketingAutomationConnectionProvider.form(MarketingAutomationConnectionProvider.java:239) ~[magnolia-marketing-automation-1.0.1-SNAPSHOT.jar:?]
      	at info.magnolia.mkautomation.ui.form.FormModel.getMarketingForm(FormModel.java:85) ~[magnolia-marketing-automation-ui-1.0.1-SNAPSHOT.jar:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
      	at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1505) ~[freemarker-2.3.29.jar:2.3.29]
      	at freemarker.ext.beans.BeanModel.invokeThroughDescriptor(BeanModel.java:231) ~[freemarker-2.3.29.jar:2.3.29]
      	at freemarker.ext.beans.BeanModel.get(BeanModel.java:150) ~[freemarker-2.3.29.jar:2.3.29]
      	at freemarker.core.Dot._eval(Dot.java:43) ~[freemarker-2.3.29.jar:2.3.29]
      	at freemarker.core.Expression.eval(Expression.java:101) ~[freemarker-2.3.29.jar:2.3.29]
      	at freemarker.core.DefaultToExpression._eval(DefaultToExpression.java:88) ~[freemarker-2.3.29.jar:2.3.29] 

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              oanh.thai Oanh Thai Hoang
              Reporter:
              ilgun Ilgun Ilgun
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: