org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Cannot map handler 'editForm' to URL path [/edit.do]: There is already handler of type [class com.spring.mvc.beans.SampleController] mapped.

cnblogs.com | 6 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Spring mvc - j2ee技术 - 博客园

    cnblogs.com | 6 months ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Cannot map handler 'editForm' to URL path [/edit.do]: There is already handler of type [class com.spring.mvc.beans.SampleController] mapped.
  2. 0

    Mapping a single controller to several beans in spring

    Stack Overflow | 3 years ago | ozgurc
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping#0' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Cannot map handler 'faqController' to URL path [/base*]: There is already handler 'indexPageController' mapped.
  3. 0

    Single @RequestMapping for multiple controllers

    Stack Overflow | 2 years ago | Venkat
    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 [clients] to URL path [//save]: There is already handler [crm.venkat.controller.Clients@7e47dc12] mapped.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Handler mapping issue after integrating with spring security

    Stack Overflow | 3 years ago | Adam
    java.lang.IllegalStateException: Cannot map handler 'LoginController' to URL path [/userdetails]: There is already handler of type [class com.sample.user.controller.MyController] mapped.
  6. 0

    Is it possible to map the same mapping with different methods to two different controllers?

    Stack Overflow | 4 years ago | jmfsg
    java.lang.IllegalStateException: Cannot map handler 'MyController#0' to URL path [/method/{key}]: There is already handler of type [class OtherController$$EnhancerByCGLIB$$54a955d] mapped.

  1. linxiaolong 1 times, last 3 months ago
  2. treefolk 2 times, last 3 months ago
2 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalStateException

    Cannot map handler 'editForm' to URL path [/edit.do]: There is already handler of type [class com.spring.mvc.beans.SampleController] mapped.

    at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler()
  2. Spring MVC
    AbstractDetectingUrlHandlerMapping.initApplicationContext
    1. org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:390)
    2. org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:362)
    3. org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.detectHandlers(AbstractDetectingUrlHandlerMapping.java:82)
    4. org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.initApplicationContext(AbstractDetectingUrlHandlerMapping.java:58)
    4 frames
  3. Spring Context
    ApplicationObjectSupport.initApplicationContext
    1. org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
    1 frame
  4. Spring
    WebApplicationObjectSupport.initApplicationContext
    1. org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72)
    1 frame
  5. Spring Context
    ApplicationContextAwareProcessor.postProcessBeforeInitialization
    1. org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
    2. org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106)
    3. org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85)
    3 frames
  6. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    5. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    6. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    7. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    8. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    9. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    9 frames
  7. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    2 frames
  8. Spring MVC
    HttpServletBean.init
    1. org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
    2. org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
    3. org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
    4. org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
    5. org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
    5 frames
  9. JavaServlet
    GenericServlet.init
    1. javax.servlet.GenericServlet.init(GenericServlet.java:160)
    1 frame
  10. Glassfish Core
    StandardContext$3.call
    1. org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1216)
    2. org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1135)
    3. org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031)
    4. org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)
    5. org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5284)
    6. org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5279)
    6 frames
  11. Java RT
    Thread.run
    1. java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    2. java.util.concurrent.FutureTask.run(Unknown Source)
    3. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    4. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    5. java.lang.Thread.run(Unknown Source)
    5 frames