Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-8136

Investigate NoClassDefFoundError when running maven tests

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: Not Applicable
    • Component/s: Infrastructure
    • Labels:
      None
    • Epic Color:
      ghx-label-4

      Description

      I encountered a NoClassDefFoundError when running maven tests. It's resolved unexpectedly by restarting the mini-cluster. My operations are:

      1. ./buildall.sh in a clean clone
      2. kill the processes after backend tests and frontend tests finish
      3. run FE tests again like
        (push fe && mvn test -Dtest=AuthorizationTest)

      Then I encountered the following error:

      Running org.apache.impala.analysis.AuthorizationTest
      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.008 sec <<< FAILURE! - in org.apache.impala.analysis.AuthorizationTest
      initializationError(org.apache.impala.analysis.AuthorizationTest)  Time elapsed: 0.006 sec  <<< ERROR!
      java.lang.NoClassDefFoundError: Could not initialize class org.apache.impala.analysis.AuthorizationTest
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
              at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
              at org.junit.runners.Parameterized.allParameters(Parameterized.java:280)
              at org.junit.runners.Parameterized.<init>(Parameterized.java:248)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
              at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
              at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
              at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
              at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
              at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
              at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
              at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
              at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
              at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
              at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
              at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
              at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
              at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      Results :
      Tests in error:
        AuthorizationTest.initializationError » NoClassDefFound Could not initialize c...
      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 19.717 s
      [INFO] Finished at: 2019-01-29T03:38:16-08:00
      [INFO] Final Memory: 116M/2090M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18:test (default-test) on project impala-frontend: There are test failures.
      [ERROR]
      [ERROR] Please refer to /tmp/jenkins/workspace/impala-hulu/logs/fe_tests for the individual test results.
      [ERROR] -> [Help 1]
      [ERROR]
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
      

      I feel like something wrong in pom.xml since it can compile successfully but fail at running. After I restarted the mini-cluster by testdata/bin/run-all.sh, the error was resolved.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              stigahuang Quanlong Huang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: