1

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?

1
  • if you are using docker image of vertx then mention vcomplete on image name vertx/vertx4:<version> eg: vertx/vertx4:4.3.2 Nov 8, 2022 at 14:31

2 Answers 2

5

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.

1
  • Yes. This was the issue. Thank you :D Jun 30, 2022 at 12:35
1
  • What can cause NoSuchMethodError with provided exception message ?

As exception suggests, it 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, specifically in your provided message it located on RoutingContextDecorator void method, see more in here.

Not the answer you're looking for? Browse other questions tagged or ask your own question.