Search code examples
javaapivert.x

NoSuchMethodError in Vertx when hitting an API


I am using Vertx to manage APIs. When I hit the API, I get a NoSuchMethodError. The error is given below:

io.vertx.ext.web.RoutingContext - Unhandled exception in router java.lang.NoSuchMethodError: 'void io.vertx.ext.web.impl.RoutingContextDecorator.(io.vertx.ext.web.Route, io.vertx.ext.web.impl.RoutingContextInternal)'

Can anyone help on what could be causing this error?


Solution

  • The most likely case for this error is that your project is including vert.x dependencies with different versions. For example, vert.x core is 4.3.1 and vert.x web is 4.2.7.

    I'd recommend you to use your build tool or IDE to verify the versions of the dependencies your project is using and make sure that they all align to the same semver.