Hi, After moving to latest analytics version(1.2.8) , we are getting class not found error [1].
This is due to the package import conflicts of spark bundle and io.dropwizard.metrics.json which imports different version of jackson packages. IOT server packs multiple jackson versions 2.4.4 and 2.8.2. Spark bundle has jackson import range of [2.4.0,2.5.0), so wired to jackson-core 2.4.4. Io.dropwizard.metrics.json bundle has jackson import range of [2.4,3), so wired to jackson-core 2.8.2. Spark also required to import Io.dropwizard.metrics.json but it fails due to two different version of jackson packages in spark bundle class space. So we need to upgrade the spark jackson version range to [2.4,3) or we need to downgrade metrics jackson version to [2.4.0,2.5.0). Appreciate any suggestions to fix the issue. [1] ERROR - AnalyticsComponent Error initializing analytics executor: Unable to create analytics client. com/codahale/metrics/json/MetricsModule org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException: Unable to create analytics client. com/codahale/metrics/json/MetricsModule at org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor. initializeSparkContext(SparkAnalyticsExecutor.java:321) at org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor. initializeAnalyticsClientLocal(SparkAnalyticsExecutor.java:303) at org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor. initializeAnalyticsClient(SparkAnalyticsExecutor.java:292) at org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor. initializeSparkServer(SparkAnalyticsExecutor.java:180) at org.wso2.carbon.analytics.spark.core.internal. AnalyticsComponent.activate(AnalyticsComponent.java:88) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.internal.ds.model.ServiceComponent. activate(ServiceComponent.java:260) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp. activate(ServiceComponentProp.java:146) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp. build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent( InstanceProcess.java:620) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents( InstanceProcess.java:197) at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged( SCRManager.java:222) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener. serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent( BundleContextImpl.java:861) at org.eclipse.osgi.framework.eventmgr.EventManager. dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue. dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl. register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl. registerService(BundleContextImpl.java:433) at org.eclipse.osgi.framework.internal.core.BundleContextImpl. registerService(BundleContextImpl.java:451) at org.eclipse.osgi.framework.internal.core.BundleContextImpl. registerService(BundleContextImpl.java:950) at org.wso2.carbon.analytics.dataservice.core.AnalyticsDataServiceComponent. activate(AnalyticsDataServiceComponent.java:72) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.internal.ds.model.ServiceComponent. activate(ServiceComponent.java:260) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp. activate(ServiceComponentProp.java:146) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp. build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent( InstanceProcess.java:620) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents( InstanceProcess.java:197) at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged( SCRManager.java:222) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener. serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent( BundleContextImpl.java:861) at org.eclipse.osgi.framework.eventmgr.EventManager. dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue. dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl. register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl. registerService(BundleContextImpl.java:433) at org.eclipse.osgi.framework.internal.core.BundleContextImpl. registerService(BundleContextImpl.java:451) at org.wso2.carbon.ntask.core.internal.TasksDSComponent. activate(TasksDSComponent.java:106) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.internal.ds.model.ServiceComponent. activate(ServiceComponent.java:260) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp. activate(ServiceComponentProp.java:146) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp. build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent( InstanceProcess.java:620) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents( InstanceProcess.java:197) at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged( SCRManager.java:222) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener. serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent( BundleContextImpl.java:861) at org.eclipse.osgi.framework.eventmgr.EventManager. dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue. dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl. register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl. registerService(BundleContextImpl.java:433) at org.eclipse.osgi.framework.internal.core.BundleContextImpl. registerService(BundleContextImpl.java:451) at org.wso2.carbon.core.internal.StartupFinalizerServiceCompone nt.completeInitialization(StartupFinalizerServiceComponent.java:199) at org.wso2.carbon.core.internal.StartupFinalizerServiceCompone nt.serviceChanged(StartupFinalizerServiceComponent.java:288) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener. serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent( BundleContextImpl.java:861) at org.eclipse.osgi.framework.eventmgr.EventManager. dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue. dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl. register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl. registerService(BundleContextImpl.java:433) at org.eclipse.osgi.framework.internal.core.BundleContextImpl. registerService(BundleContextImpl.java:451) at org.wso2.carbon.throttling.agent.internal.ThrottlingAgentServiceComponen t.registerThrottlingAgent(ThrottlingAgentServiceComponent.java:123) at org.wso2.carbon.throttling.agent.internal.ThrottlingAgentServiceComponen t.activate(ThrottlingAgentServiceComponent.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.internal.ds.model.ServiceComponent. activate(ServiceComponent.java:260) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp. activate(ServiceComponentProp.java:146) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp. build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent( InstanceProcess.java:620) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents( InstanceProcess.java:197) at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged( SCRManager.java:222) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener. serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent( BundleContextImpl.java:861) at org.eclipse.osgi.framework.eventmgr.EventManager. dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue. dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl. register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl. registerService(BundleContextImpl.java:433) at org.eclipse.osgi.framework.internal.core.BundleContextImpl. registerService(BundleContextImpl.java:451) at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon( CarbonServerManager.java:514) at org.wso2.carbon.core.init.CarbonServerManager.start( CarbonServerManager.java:219) at org.wso2.carbon.core.internal.CarbonCoreServiceComponent.activate( CarbonCoreServiceComponent.java:94) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.internal.ds.model.ServiceComponent. activate(ServiceComponent.java:260) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp. activate(ServiceComponentProp.java:146) at org.eclipse.equinox.internal.ds.model.ServiceComponentProp. build(ServiceComponentProp.java:345) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent( InstanceProcess.java:620) at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents( InstanceProcess.java:197) at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343) at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged( SCRManager.java:222) at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener. serviceChanged(FilteredServiceListener.java:107) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent( BundleContextImpl.java:861) at org.eclipse.osgi.framework.eventmgr.EventManager. dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue. dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. publishServiceEventPrivileged(ServiceRegistry.java:819) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. publishServiceEvent(ServiceRegistry.java:771) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl. register(ServiceRegistrationImpl.java:130) at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry. registerService(ServiceRegistry.java:214) at org.eclipse.osgi.framework.internal.core.BundleContextImpl. registerService(BundleContextImpl.java:433) at org.eclipse.equinox.http.servlet.internal.Activator. registerHttpService(Activator.java:81) at org.eclipse.equinox.http.servlet.internal.Activator. addProxyServlet(Activator.java:60) at org.eclipse.equinox.http.servlet.internal.ProxyServlet. init(ProxyServlet.java:40) at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet. init(DelegationServlet.java:38) at org.apache.catalina.core.StandardWrapper.initServlet( StandardWrapper.java:1282) at org.apache.catalina.core.StandardWrapper.loadServlet( StandardWrapper.java:1195) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1085) at org.apache.catalina.core.StandardContext.loadOnStartup( StandardContext.java:5349) at org.apache.catalina.core.StandardContext.startInternal( StandardContext.java:5641) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase$StartChild.call( ContainerBase.java:1571) at org.apache.catalina.core.ContainerBase$StartChild.call( ContainerBase.java:1561) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run( ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NoClassDefFoundError: com/codahale/metrics/json/ MetricsModule at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:274) at org.apache.spark.util.Utils$.classForName(Utils.scala:175) at org.apache.spark.metrics.MetricsSystem$$anonfun$registerSinks$1.apply( MetricsSystem.scala:190) at org.apache.spark.metrics.MetricsSystem$$anonfun$registerSinks$1.apply( MetricsSystem.scala:186) at scala.collection.mutable.HashMap$$anonfun$foreach$1. apply(HashMap.scala:98) at scala.collection.mutable.HashMap$$anonfun$foreach$1. apply(HashMap.scala:98) at scala.collection.mutable.HashTable$class.foreachEntry( HashTable.scala:226) at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:39) at scala.collection.mutable.HashMap.foreach(HashMap.scala:98) at org.apache.spark.metrics.MetricsSystem.registerSinks( MetricsSystem.scala:186) at org.apache.spark.metrics.MetricsSystem.start(MetricsSystem.scala:100) at org.apache.spark.SparkContext.<init>(SparkContext.scala:540) at org.apache.spark.api.java.JavaSparkContext.<init>( JavaSparkContext.scala:59) at org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor. initializeSparkContext(SparkAnalyticsExecutor.java:319) ... 144 more Caused by: java.lang.ClassNotFoundException: com.codahale.metrics.json.MetricsModule cannot be found by spark-core_2.10_1.6.2.wso2v1 at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal( BundleLoader.java:501) at org.eclipse.osgi.internal.loader.BundleLoader.findClass( BundleLoader.java:421) at org.eclipse.osgi.internal.loader.BundleLoader.findClass( BundleLoader.java:412) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass( DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 159 more -- Regards, Waruna Lakshitha Jayaweera Senior Software Engineer WSO2 Inc; http://wso2.com phone: +94713255198 http://waruapz.blogspot.com/
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev