org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'campaignRedirectsController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping com.sdl.webapp.common.controller.BaseController.requestMappingHandlerMapping; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'pageController' bean method public java.lang.String com.sdl.webapp.common.controller.BaseController.handleJspIncludesErrors() to {[/system/mvc/Shared/Error/SectionError],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'campaignRedirectsController' bean method public java.lang.String com.sdl.webapp.common.controller.BaseController.handleJspIncludesErrors() mapped.

Tridion | Saurabh Jha | 6 months ago
  1. 0

    Could not autowire field in custom controller

    Tridion | 6 months ago | Saurabh Jha
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'campaignRedirectsController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping com.sdl.webapp.common.controller.BaseController.requestMappingHandlerMapping; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'pageController' bean method public java.lang.String com.sdl.webapp.common.controller.BaseController.handleJspIncludesErrors() to {[/system/mvc/Shared/Error/SectionError],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'campaignRedirectsController' bean method public java.lang.String com.sdl.webapp.common.controller.BaseController.handleJspIncludesErrors() mapped.
  2. 0

    Caused by: java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'appController' bean method

    Stack Overflow | 1 year ago | besmart
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'appController' bean method public java.lang.String it.besmart.controller.AppController.newClient(org.springframework.ui.ModelMap) to {[//new],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'appController' bean method public java.lang.String it.besmart.controller.AppController.saveClient(it.besmart.models.Client,org.springframework.validation.BindingResult,org.springframework.ui.ModelMap) mapped.
  3. 0

    Spring Social - Is it possible and if yes how to override methods from ConnectController?

    Stack Overflow | 3 years ago | Todor Kolev
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'myConnectController' bean method public java.lang.String org.springframework.social.connect.web.ConnectController.connectionStatus(java.lang.String,org.springframework.web.context.request.NativeWebRequest,org.springframework.ui.Model) to {[/connect/{providerId}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'myConnectController' bean method public org.springframework.web.servlet.view.RedirectView com.buzz.social.connect.MyConnectController.get(java.lang.String,org.springframework.web.context.request.NativeWebRequest) mapped.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring RESTful API :: Using Traits for the @RestController methods

    Stack Overflow | 2 years ago | Trevor Donahue
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'publicationController' bean method public abstract com.example.project.core.Author com.example.project.api._trait.ReadTrait.read(java.lang.String) to {[/{resource}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'authorController' bean method public abstract com.example.project.core.Author com.example.project.api._trait.ReadTrait.read(java.lang.String) mapped.
  6. 0

    Spring RESTful API :: Using Traits for the @RestController methods - scriptscoop.com

    iswwwup.com | 1 year ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'publicationController' bean method public abstract com.example.project.core.Author com.example.project.api._trait.ReadTrait.read(java.lang.String) to {[/{resource}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'authorController' bean method public abstract com.example.project.core.Author com.example.project.api._trait.ReadTrait.read(java.lang.String) mapped.

    1 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

      Ambiguous mapping found. Cannot map 'pageController' bean method public java.lang.String com.sdl.webapp.common.controller.BaseController.handleJspIncludesErrors() to {[/system/mvc/Shared/Error/SectionError],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'campaignRedirectsController' bean method public java.lang.String com.sdl.webapp.common.controller.BaseController.handleJspIncludesErrors() mapped.

      at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod()
    2. Spring MVC
      AbstractHandlerMethodMapping.afterPropertiesSet
      1. org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:179)
      2. org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:145)
      3. org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:107)
      4. org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:87)
      4 frames
    3. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
      5. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
      6. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      7. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
      8. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      9. org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
      10. org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
      11. org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
      12. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
      13. org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
      14. org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
      15. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1208)
      16. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
      17. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
      18. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
      19. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      20. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
      21. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      22. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
      22 frames
    4. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:759)
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
      2 frames
    5. Spring
      ContextLoaderListener.contextInitialized
      1. org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:388)
      2. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
      3. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
      3 frames
    6. Glassfish Core
      HostConfig$DeployDirectory.run
      1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727)
      2. org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
      3. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      4. org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
      5. org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
      6. org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
      7. org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)
      8. org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786)
      8 frames
    7. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      2. java.util.concurrent.FutureTask.run(Unknown Source)
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      5. java.lang.Thread.run(Unknown Source)
      5 frames