Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-3822

Kafka pack 0.7 fails because ArtifactClassLoaderFactory loads scala classes from a later scala version

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.6.0
    • Component/s: CDAP Packs
    • Labels:
    • Release Notes:
      Unit Test framework now has the capability to exclude scala, so users can depend on their own version of the library.
    • Rank:
      1|hzz0ov:

      Description

      ArtifactClassLoaderFactory loads spark classes at https://github.com/caskdata/cdap/blob/release/3.2/cdap-app-fabric/src/main/java/co/cask/cdap/internal/app/runtime/artifact/ArtifactClassLoaderFactory.java#L62, which brings needed classes from a higher version of scala (>2.8).
      As a result, cdap-kafka-pack-0.7 fails with the following error:

      java.lang.NoClassDefFoundError: scala/Cloneable
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
      	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
      	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      	at co.cask.cdap.internal.app.runtime.spark.SparkUtils.createSparkFrameworkClassLoader(SparkUtils.java:138)
      	at co.cask.cdap.internal.app.runtime.artifact.ArtifactClassLoaderFactory.createClassLoader(ArtifactClassLoaderFactory.java:62)
      	at co.cask.cdap.internal.app.runtime.artifact.ArtifactRepository.addArtifact(ArtifactRepository.java:278)
      	at co.cask.cdap.internal.app.services.ApplicationLifecycleService.deployAppAndArtifact(ApplicationLifecycleService.java:305)
      	at co.cask.cdap.gateway.handlers.AppLifecycleHttpHandler$2.onFinish(AppLifecycleHttpHandler.java:393)
      	at co.cask.cdap.common.http.AbstractBodyConsumer.finished(AbstractBodyConsumer.java:65)
      	at co.cask.cdap.internal.AppFabricClient.deployApplication(AppFabricClient.java:383)
      	at co.cask.cdap.test.UnitTestManager.deployApplication(UnitTestManager.java:156)
      	at co.cask.cdap.test.ConfigurableTestBase.deployApplication(ConfigurableTestBase.java:430)
      	at co.cask.cdap.test.ConfigurableTestBase.deployApplication(ConfigurableTestBase.java:424)
      	at co.cask.cdap.test.ConfigurableTestBase.deployApplication(ConfigurableTestBase.java:445)
      	at co.cask.cdap.kafka.flow.KafkaConsumerFlowletTestBase.testInvalidStartOffsetSmaller(KafkaConsumerFlowletTestBase.java:301)
      	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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
      	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
      	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
      	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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
      	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
      	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ali.anwar Ali Anwar
                Reporter:
                bhooshan Bhooshan Mogal
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: