Jun 5th, 2012, 10:25 AM
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!
Jun 5th, 2012, 10:44 AM
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.
Jun 5th, 2012, 12:10 PM
Ok, I see -
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