Questions tagged [nosuchmethoderror]

The Java `Error` thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method.

The Java Error thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method.

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.

See Oracle javadocs for more details

Don't confuse it with NoSuchMethodException, see Difference between NoSuchMethodException and NoSuchMethodError in Java for more details.

Popular questions

604 questions
194
votes
31 answers

How do I fix a NoSuchMethodError?

I'm getting a NoSuchMethodError error when running my Java program. What's wrong and how do I fix it?
John Meagher
  • 20,560
  • 13
  • 50
  • 57
73
votes
2 answers

Interpreting java.lang.NoSuchMethodError message

I get the following runtime error message (along with the first line of the stack trace, which points to line 94). I'm trying to figure out why it says no such method exists. java.lang.NoSuchMethodError:…
dougkramer
  • 1,045
  • 2
  • 9
  • 12
61
votes
8 answers

"Error: Main method not found in class MyClass, please define the main method as..."

New Java programmers often encounter these messages when they attempt to run a Java program. Error: Main method not found in class MyClass, please define the main method as: public static void main(String[] args) or a JavaFX application class…
Stephen C
  • 632,615
  • 86
  • 730
  • 1,096
39
votes
7 answers

Resolving dependency problems in Apache Spark

The common problems when building and deploying Spark applications are: java.lang.ClassNotFoundException. object x is not a member of package y compilation errors. java.lang.NoSuchMethodError How these can be resolved?
39
votes
15 answers

Getting NoSuchMethodError: javax.servlet.ServletContext.addServlet in Spring Boot while running a Spring MVC application

I am getting below exception when I am trying to run a Spring MVC application using Spring boot... ContainerBase: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start…
27
votes
7 answers

Java "NoSuchMethodError"

I'm getting: NoSuchMethodError: com.foo.SomeService.doSmth()Z Am I understanding correctly that this 'Z' means that return type of doSmth() method is boolean? If true, then that kind of method really does not exist because this method returns some…
vrm
  • 1,223
  • 3
  • 20
  • 27
23
votes
9 answers

Jackson ObjectMapper() constructor throws NoSuchMethod

I'm using Jackson sample code to deserialize a POJO: ObjectMapper m = new ObjectMapper(); This line throws a NoSuchMethodError: Exception in thread "main" java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.(Ljava/lang/Class;)V …
Mojo
  • 2,617
  • 3
  • 28
  • 42
23
votes
9 answers

(run-main-0) java.lang.NoSuchMethodError

I got a problem when I used sbt to run a spark job, I have finish compile, but when I run the command run, I got the problem below [error] (run-main-0) java.lang.NoSuchMethodError:…
zhang
  • 371
  • 3
  • 4
  • 13
21
votes
1 answer

ProGuard with Android: java.lang.NoSuchMethodError: android.util.Xml.asAttributeSet

My app runs normally when ProGuard is disabled. After ProGuard is enabled, the app is exported into apk and installed into emulator. Then when I run it in emulator, force close... 05-10 11:14:10.582: E/AndroidRuntime(759): FATAL EXCEPTION:…
kel
  • 810
  • 6
  • 11
18
votes
6 answers

Spring boot: java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getHttpServletMapping()Ljavax/servlet/http/HttpServletMapping;

When I run this application on built-in server or other tomcat server it gives me following error message. I am using jdk8, STS V-3.9.7. Can someone help me resolve it Simple Springboot application with following content: application.properties…
Ramesh Kumar
  • 245
  • 1
  • 3
  • 9
17
votes
3 answers

RESTEasy Client + NoSuchMethodError

I am trying to write simple RESTEasy client. Below given is sample code: Client client = ClientBuilder.newBuilder().build(); WebTarget target = client.target("http://localhost:8080/context/path"); Response response =…
user613114
  • 2,459
  • 10
  • 40
  • 68
16
votes
4 answers

Understanding method signature in NoSuchMethod exception

I got this exception but resolved it. java.lang.NoSuchMethodError: antlr.NoViableAltForCharException. (CLjava/lang/String;II)V But i'd like to know how to interpret these kind of messages: "(CLjava/lang/String;II)V" Also, does this "init"…
popcoder
  • 2,552
  • 6
  • 30
  • 45
16
votes
1 answer

NoSuchMethodError when using RESTEasyClient on Android

I am developing an Android app and using a library that in turn depends on RESTEasyClient. When using the library at runtime, I get a NoSuchMethodError: java.lang.NoSuchMethodError: No direct method…
O.O.Balance
  • 2,507
  • 4
  • 20
  • 34
16
votes
9 answers

Using onClick attribute in layout xml causes a NoSuchMethodException in Android dialogs

I have created a custom dialog and a layout xml:
Impression
  • 727
  • 1
  • 5
  • 14
14
votes
2 answers

Hibernate 5.2.7 - java.lang.NoSuchMethodError: org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Map;

while using Hibernate 5.2.7 in a Gradle Java Project to connect to a MariaDB 10.1.19, I am getting an Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Map; The…
Marcel
  • 141
  • 1
  • 1
  • 4
1
2 3
40 41