Ambiguous mapping error when using generic interface [SPR-16288] #20835
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: regression
A bug that is also a regression
Milestone
Robert Thornton opened SPR-16288 and commented
I've upgraded my project from Spring Boot 1.5.8.RELEASE (using Spring Framework 4.3.12) to 1.5.9.RELEASE (using Spring Framework 4.3.13), and I am now getting an ambiguous mapping error on startup.
I've isolated the cause and simplified it to the following sample code that reproduces the issue:
The
ArticleController
class implements two interfaces:ApiConstants
, andResourceEndpoint
. TheResourceEndpoint
interface is a generic interface that accepts type parameters for the resource entity and a predicate. If I remove theApiConstants
interface, the error goes away, suggesting that Spring MVC may be confused when the controller implements more than one interface. I've verified that the above code still works on Spring Boot 1.5.8 (using Spring Framework 4.3.12)The above sample code doesn't demonstrate why I'm using the two interfaces. Its intent is simply to demonstrate the regression in functionality.
Affects: 4.3.13
Issue Links:
Referenced from: pull request #1632, and commits 347c2da, 69c882c, 121f9e3
Backported to: 4.3.14
The text was updated successfully, but these errors were encountered: