Hello i'm new at spring. I'm developing a STS app to learn, i've created a Template Project - Spring MVC Project, i have several controllers, but the problem is that when i try to access to a folder with two different controllers (for example trial1.jsp and another trial2.jsp (@RequestMapping) and both JSP are in the same folder) i get an error message and i have to put the JSP in different folders (then it works) but i need them in the same folder
The error message that is dispayed is the following, occurs when you run the tomcat.
******
ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annota tion.RequestMappingHandlerMapping#0': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'trampsSameController' bean method
public java.lang.String com.duckranger.goodproject.controllers.TrampsSameC ontroller.listSame(org.springframework.ui.Model)
to {[/populate],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'trampsController' bean method
public java.lang.String com.duckranger.goodproject.controllers.TrampsContr oller.listMap(org.springframework.ui.Model) mapped.
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 94)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:225)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:291 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:913)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:464)
at org.springframework.web.context.ContextLoader.conf igureAndRefreshWebApplicationContext(ContextLoader .java:384)
at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 111)
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:4779)
at org.apache.catalina.core.StandardContext.startInte rnal(StandardContext.java:5273)
at org.apache.catalina.util.LifecycleBase.start(Lifec ycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild. call(ContainerBase.java:1566)
at org.apache.catalina.core.ContainerBase$StartChild. call(ContainerBase.java:1556)
at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.jav a:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'trampsSameController' bean method
public java.lang.String com.duckranger.goodproject.controllers.TrampsSameC ontroller.listSame(org.springframework.ui.Model)
to {[/populate],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}: There is already 'trampsController' bean method
public java.lang.String com.duckranger.goodproject.controllers.TrampsContr oller.listMap(org.springframework.ui.Model) mapped.
at org.springframework.web.servlet.handler.AbstractHa ndlerMethodMapping.registerHandlerMethod(AbstractH andlerMethodMapping.java:181)
at org.springframework.web.servlet.handler.AbstractHa ndlerMethodMapping.detectHandlerMethods(AbstractHa ndlerMethodMapping.java:145)
at org.springframework.web.servlet.handler.AbstractHa ndlerMethodMapping.initHandlerMethods(AbstractHand lerMethodMapping.java:107)
at org.springframework.web.servlet.handler.AbstractHa ndlerMethodMapping.initApplicationContext(Abstract HandlerMethodMapping.java:87)
at org.springframework.context.support.ApplicationObj ectSupport.initApplicationContext(ApplicationObjec tSupport.java:119)
at org.springframework.web.context.support.WebApplica tionObjectSupport.initApplicationContext(WebApplic ationObjectSupport.java:72)
at org.springframework.context.support.ApplicationObj ectSupport.setApplicationContext(ApplicationObject Support.java:73)
at org.springframework.context.support.ApplicationCon textAwareProcessor.invokeAwareInterfaces(Applicati onContextAwareProcessor.java:117)
at org.springframework.context.support.ApplicationCon textAwareProcessor.postProcessBeforeInitialization (ApplicationContextAwareProcessor.java:92)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyBeanPostProcessors BeforeInitialization(AbstractAutowireCapableBeanFa ctory.java:394)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1448)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
... 21 more
******
Thanks for your help


Reply With Quote
