Skip to content

Mixed "Straight Web" and Spring Data Rest Fails #1707

Closed

Description

@bep

I have an app with a "straight webapp-controller" mapped to / and a Spring Data Rest API mapped to /api ( config.setBaseUri("/api")).

This works fine in Spring Boot 1.2.M1, but fails in 1.2.M2 -- probably related to this issue:

https://jira.spring.io/browse/DATAREST-338

I get this on startup:

Caused by: java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'repositoryController' bean method 
public org.springframework.http.HttpEntity<org.springframework.data.rest.webmvc.RepositoryLinksResource> org.springframework.data.rest.webmvc.RepositoryController.listRepositories()
to {[/],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'mainController' bean method
java.lang.String wikiboot.support.MainController.index(org.springframework.ui.ModelMap) mapped.
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:215)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:187)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:147)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:126)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:126)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1627)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1564)
    ... 44 more

Activity

  1. wilkinsona commented on Oct 14, 2014

    @wilkinsona
    Member

    I believe this is DATAREST-381. You can try using 2.3.0.BUILD-SNAPSHOT to confirm.

  2. added
    status: waiting-for-feedback
    on Oct 14, 2014
  3. bep commented on Oct 14, 2014

    @bep
    ContributorAuthor

    Yes, all works fine with 2.3.0.BUILD-SNAPSHOT.

  4. wilkinsona commented on Oct 14, 2014

    @wilkinsona
    Member

    Thanks for the confirmation. The fix will also be in 2.2.1 (part of SR1 of the Evans release train) which 1.2 will move to.

  5. removed
    status: waiting-for-feedback
    on Oct 14, 2014
  6. alvarezmario commented on Oct 28, 2014

    @alvarezmario
    Contributor

    I'm new around here and using Spring, so sorry if this question is wrong or out of context, but when is planned the next release of the Evans train and the estimated time of Boot 1.2 GA.
    Just for curiosity..

  7. wilkinsona commented on Oct 28, 2014

    @wilkinsona
    Member

    You can see a rough schedule for Spring Boot here. I'm not sure about Spring Data Evans SR1. @olivergierke can you comment please?

  8. odrotbohm commented on Oct 28, 2014

    @odrotbohm
    Member

    We'll ship Evans SR1 by Thursday, M1 of Fowler about to follow in two weeks.

  9. alvarezmario commented on Oct 28, 2014

    @alvarezmario
    Contributor

    Thanks for the info.

    2014-10-28 14:47 GMT-05:00 Oliver Gierke [email protected]:

    We'll ship Evans SR1 by Thursday, M1 of Fowler about to follow in two
    weeks.

    —
    Reply to this email directly or view it on GitHub
    #1707 (comment)
    .

  10. bep commented on Oct 28, 2014

    @bep
    ContributorAuthor

    Is it Robbie Fowler the football player and Bill Evans the pianist :-?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions