That usually means that the referenced class used to compile the code and the class in the classpath used to run the code are different. When the code was compiled, the method existed in the class. But when the code was run, the method didn't exist. You can check to see that you are using the same classes in both compile and runtime.