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

I created a web service in netbeans 6.7 and one project for the client. The web service has a method that executes some queries from the database and returns an array to me. calling the web service method in the client.jsp file in the web client service gives an 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 imported cans from hadoop.

+4
source share
9 answers

I met the same exception with you. In my cases, this is caused by conflicts between the set-top box libraries and the Hadoop / HBase libraries (maybe both of them contain the org.eclipse.jdt.internal.compiler.CompilationResult method). I resolve this error by adding the following exceptions to the Hadoop / HBase dependency:

  <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> 
+5
source

I had the same problem with jars from the Howop, which in turn depend on some berth packages. I solved this by posting the following exceptions in a dependent dependency:

 <exclusions> <exclusion> <groupId>org.mortbay.jetty</groupId> <artifactId>servlet-api</artifactId> </exclusion> <exclusion> <groupId>org.mortbay.jetty</groupId> <artifactId>servlet-api-2.5</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> </exclusions> 
+2
source

You have several versions of the library containing org.eclipse.jdt.internal.compiler.CompilationResult in your class path, and they are ordered so that the version in which the CompilationResult.getProblems() method does not exist (or has been incompatibly changed), occurs first on the class path, probably because it is provided by any container in which you work.

Possible solutions:

  • Reorder the class path to avoid the problem.
  • If this is a Maven project, exclude duplicate JARs as dependencies (in NetBeans, expand the Node Libraries and right-click the library and select Exclude Dependency from the pop-up menu)
+1
source

I excluded the following dependencies from "org.apache.hbase" in the pom.xml file

 <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>tomcat</groupId> <artifactId>jasper-compiler</artifactId> </exclusion> <exclusion> <groupId>tomcat</groupId> <artifactId>jasper-runtime</artifactId> </exclusion> 

This solved my problem.

+1
source

In my case, it was due to a conflict of dependents, but it was difficult to find out which bank is the cause of the conflict.

So, to check for conflict, pom.xml has a Dependency Hierarchy tab in eclipse. In the Resolved Dependency section, check if there are two banks with the same name. If found, then exclude one of them from the parent dependency.

enter image description here

In my case, it was a jsp-api jar, by clicking the jsp-api jar, I found that the parent dependency is activemq-core , so I excluded the jsp-api jar from dependemq-core and it works fine.

 <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-core</artifactId> <version>5.6.0</version> <exclusions> <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> </exclusions> </dependency> 
+1
source

try starting by removing ecj-xxxjar from your tomcat library

0
source

I started working on hadoop and wanted to integrate in order to be included in the application from the application. SO added a hadoop maven dependency and all these errors caused by the application. As soon as I removed my dependency on hadoop, the errors disappeared.

0
source

I fixed this using the correct version of the servlet API: Tomcat 7.x expects version 3.0.x, not 3.1.x, which I tried to use. See Also, “ What does the abusive class say when starting the server?”

0
source

HI is because of jsp page compilers. In my case, jsp pages are developed in the old version of tomcat, and then I deploy to the new version of tomcat, after which I got java.lang.NoSuchMethodError: org.eclipse.jdt.internal. compiler.CompilationResult.getProblems () [Lorg / eclipse / JDT / kernel / compiler / IProblem; then I added jasper. and 'ecj., el -. * 'on the build path. I succeeded.

0
source

Source: https://habr.com/ru/post/1491002/


All Articles