java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult hadoop hadoop

java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult


I met the same exception with you. In my cases, it's caused by the jetty library conflicts with Hadoop/HBase libraries( maybe both contain org.eclipse.jdt.internal.compiler.CompilationResult method). I solve this bug by adding following exclusions into Hadoop/HBase dependencies:

      <dependency>      <groupId>org.apache.hadoop</groupId>      <artifactId>hadoop-common</artifactId>      <version>${hadoop.version2}</version>      <exclusions>        <exclusion>            <groupId>org.mortbay.jetty</groupId>            <artifactId>jetty</artifactId>        </exclusion>        <exclusion>            <groupId>org.mortbay.jetty</groupId>            <artifactId>jetty-util</artifactId>        </exclusion>        <exclusion>            <groupId>org.mortbay.jetty</groupId>            <artifactId>jsp-2.1</artifactId>        </exclusion>        <exclusion>            <groupId>org.mortbay.jetty</groupId>            <artifactId>jsp-api-2.1</artifactId>        </exclusion>        <exclusion>            <groupId>org.mortbay.jetty</groupId>            <artifactId>servlet-api-2.1</artifactId>        </exclusion>        <exclusion>            <groupId>javax.servlet</groupId>            <artifactId>servlet-api</artifactId>        </exclusion>        <exclusion>            <groupId>javax.servlet.jsp</groupId>            <artifactId>jsp-api</artifactId>        </exclusion>        <exclusion>            <groupId>tomcat</groupId>            <artifactId>jasper-compiler</artifactId>        </exclusion>        <exclusion>            <groupId>tomcat</groupId>            <artifactId>jasper-runtime</artifactId>        </exclusion>      </exclusions>    </dependency>


try running by removing ecj-x.x.x.jar from your tomcat library


You have multiple versions of the library containing org.eclipse.jdt.internal.compiler.CompilationResult on your classpath, and they are ordered so that a version in which the method CompilationResult.getProblems() does not exist (or was incompatibly changed) comes first on the classpath, probably because it is provided by whatever container you're running in.

Possible solutions:

  • Reorder the classpath to avoid the problem
  • If it is a Maven project, exclude the duplicate JARs as dependencies (in NetBeans, expand the Libraries node and right click the library and choose Exclude Dependency from the popup menu)