Scooter
Scooter

Reputation: 1079

Java GWT Compile Error NoSuchMethodError

This is the error:

enter image description here

I'm new to compiling GWT apps and I've heard that compile errors are pretty common so any advice on how to debug these types of exceptions in the future would be greatly appreciated. Thanks!

EDIT: Since I am new to these errors if I'm missing any information on how to fix this please let me know with a comment and I'll post everything I can.

Upvotes: 0

Views: 60

Answers (2)

Thomas Broyer
Thomas Broyer

Reputation: 64561

In this specific case, make sure you don't mix GWT dependencies from different GWT versions. It's likely that you have gwt-codeserver (which is actually useless, as all classes are also in gwt-dev) and gwt-dev from different versions.

Upvotes: 1

java_doctor_101
java_doctor_101

Reputation: 3367

Since your question is little generic, here is a generic approach to debug such errors. I follow this apporoach to debug NoSuchClass and NoSuchMethod exception while writing Android apps;

  1. Make sure you are importing the correct libraries.

  2. Look at the stack trace. If the exception appears when calling a method on an object in a library, you are most likely using separate versions of the library when compiling and running. Make sure you have the right version both places.

  3. Could be caused by conflicting versions of JARs.

  4. NoSuchMethodError is different from NoSuchMethodException. The latter is usually occurs with non-reflective code. Do not get confused between two.

Upvotes: 1

Related Questions