Results 1 to 3 of 3

Thread: re: how to resolve BeanCreationException in autowiring

  1. #1
    Join Date
    Sep 2008
    Posts
    8

    Default re: how to resolve BeanCreationException in autowiring

    Can anyone please recommend a few things to look for in diagnosing the following error? I believe my controllers
    are set up correctly, but Spring is complaining

    Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.De faultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Cannot map handler 'testController1' to URL path [/index]: There is already handler of type [TestController2$$EnhancerByCGLIB$$7e0a1cc4] mapped.
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean

    Does anyone know what this above error message means and some things to look for in resolving it?

    I am using Spring 3.0.5.

    Thanks for any advice on this!

  2. #2
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    709

    Default

    You already have one registered @Controller (TestController2) mapped to the /index URL path. Choose which one of your controller should handle a /index request, either TestController1 OR TestController2 but not both.

  3. #3
    Join Date
    Sep 2008
    Posts
    8

    Default

    Ok, I see -

    sub1/index.html

    or

    sub2/index.html

    would be two different URL paths, but /index alone would not work. So, I need to find out where the URLs are not
    being differentiated by the subdirectory, in the path. There must be some mistake somewhere causing just /index to be
    mapped, which is not correct.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •