Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have created a web service in netbeans 6.7 and one project for client. The web service has a method which does some query from database and returns me an array. Calling the web service method in client.jsp file in web clients service gives error :

javax.servlet.ServletException: java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/IProblem;
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)

root cause

java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/IProblem;
    org.apache.jasper.compiler.JDTCompiler$2.acceptResult(JDTCompiler.java:354)
    org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:398)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:425)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
`

I have imported jars from hadoop.

like image 582
naveen kumar Avatar asked Jul 11 '13 20:07

naveen kumar


2 Answers

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>
like image 110
Jinfeng Avatar answered Oct 25 '22 05:10

Jinfeng


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

like image 4
thiru_k Avatar answered Oct 25 '22 03:10

thiru_k