I am trying to fetch some data from Google Analytics using Google Analytics reporting v4 API. I am using maven so included all the 9 modules in maven dependency.
However while running the sample java code from https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/service-java
I am getting NoClassDefFoundError. On debugging further the actual line which was failing is Utils.getDefaultJsonFactory();
Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/json/async/NonBlockingJsonParser
at com.google.api.client.json.jackson2.JacksonFactory.<init>(JacksonFactory.java:41)
at com.google.api.client.googleapis.util.Utils$JsonFactoryInstanceHolder.<clinit>(Utils.java:44)
at com.google.api.client.googleapis.util.Utils.getDefaultJsonFactory(Utils.java:36)
at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.fromStream(GoogleCredential.java:232)
at com.dropbox.aem.common.services.GoogleAnalyticsReporting.initializeAnalyticsReporting(GoogleAnalyticsReporting.java:58)
at com.dropbox.aem.common.services.GoogleAnalyticsReporting.main(GoogleAnalyticsReporting.java:38)
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.json.async.NonBlockingJsonParser
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 6 more