-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DuplicateRouteException when using two Controller uris #10957
Comments
Hello; can I work on this? |
sure |
Hi @ersalazar , are you working on this? Should we throw a new exception (such as MultipleRouteException) which communicates a more succinct message? |
better error messages are always good |
Hello @pragyamutluru, yes I'm working on it. I know its been a bit long but I ran into an issue where I couldnt run the project locally but that was fixed yesterday in this PR #10990 |
I'm trying to replicate the error in version 4.6.x but it seems to be fixed. When I try to go to version 4.2.x where this error was reported I get the same dependency error that was patched in 4.6.x with PR #10990 Can anyone help me with this? |
@yawkat can you help me with this? |
I think the easiest way would be to try reproducing this bug outside micronaut-core, where #10990 does not apply. That can help narrow down whether this issue existed in 4.2.x. |
I am also unable to reproduce the issue with 4.6.x and with 4.2.x. |
Thanks for testing. I will close this issue for now. @johndevs please provide a test case. |
Thanks everyone for testing! We did quite a big migration from Anyway, sorry to bother you all with testing an old version; but great to see such an active team working on Micronaut! 🍻 |
@yawkat I have managed to reproduce the issue now on 4.5.1 as well. Attached a minimal test-case. I would expect the test in the project to pass. |
Thanks for the reproducer. I think it still uses the default value for |
🥳 |
Expected Behavior
When I create two end-points like this:
And call /foo then I expect
method1()
to be executed.I would also expect if there is an error with duplicate routing that the error log would include the controller class and method names for easier debugging.
Actual Behaviour
Instead I get DuplicateRouteException thrown from the
Router#findClosest(request)
with the message:More than 1 route matched the incoming request. The following routes matched /: GET - /, GET - /
From this message it is not clear which controller methods are conflicting nor is the error correct.
Apparently the Router only considers the
uri
parameter, noturis
.Steps To Reproduce
No response
Environment Information
No response
Example Application
No response
Version
4.2.2
The text was updated successfully, but these errors were encountered: