Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-2528

Two controllers over an entity error because same request mapping

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.1.4.RELEASE
    • Fix Version/s: 1.1.5.RELEASE
    • Component/s: WEB MVC
    • Labels:
    • Environment:
      Linux Ubuntu 10.10, Apache Maven 3.0.2, Java 1.6.0_23

      Description

      Creating more than one controller over the same entity causes startup errors because they are created with the same base request mapping name:

      @RequestMapping("/owners")

      To reproduce, execute next command after clinic.roo script:

      web mvc scaffold --class ~.web.OtherOwnerController --backingType ~.domain.Owner

      On startup:

      2011-06-27 11:03:09,850 [main] ERROR org.springframework.web.servlet.DispatcherServlet - Context initialization failed
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Cannot map handler 'ownerController' to URL path [/owners/{id}]: There is already handler of type [class com.springsource.petclinic.web.OtherOwnerController] mapped.
      

        Attachments

          Activity

            People

            Assignee:
            sschmidt Stefan Schmidt
            Reporter:
            mmartinez Mario Martínez Sánchez - gvNIX - DISID
            Votes:
            5 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3h
                3h
                Remaining:
                Remaining Estimate - 3h
                3h
                Logged:
                Time Spent - Not Specified
                Not Specified