嗨,我正在使用RestMull webservices和SpringMvc,我在启动apache服务器时遇到了以下异常。请帮我解决这个问题

时间:2017-08-25 18:40:36

标签: spring-mvc

  

错误说明   :org.springframework.beans.factory.BeanCreationException:错误   用名字创建bean   'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0':   调用init方法失败;嵌套异常是   java.lang.IllegalStateException:找到了不明确的映射。无法映射   'xyz'bean方法公开   v1.com.practiceproject.response.ResponseObject   v1.com.practiceproject.service.xyz.getSelectedProduct(java.lang.String)抛出java.lang.Exception到   {[/人/人],方法= [GET],则params = [],标题= [],消耗= [],产生= [应用/ JSON],定制= []}:   已经有'personService'bean方法公开了   v1.com.practiceproject.response.ResponseObject   v1.com.practiceproject.service.PersonService.getSelectedProduct(java.lang.String中)   抛出java.lang.Exception映射。在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)     在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)     在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)     在   org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:304)     在   org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)     在   org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)     在   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)     在   org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700)     在   org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)     在   org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)     在   org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)     在   org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)     在   org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)     在   org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)     在   org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1559)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1549)     在java.util.concurrent.FutureTask.run(未知来源)at   java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)at   java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)at   java.lang.Thread.run(未知来源)引起:   java.lang.IllegalStateException:找到了不明确的映射。无法映射   'xyz'bean方法公开   v1.com.practiceproject.response.ResponseObject   v1.com.practiceproject.service.xyz.getSelectedProduct(java.lang.String)抛出java.lang.Exception到   {[/人/人],方法= [GET],则params = [],标题= [],消耗= [],产生= [应用/ JSON],定制= []}:   已经有'personService'bean方法公开了   v1.com.practiceproject.response.ResponseObject   v1.com.practiceproject.service.PersonService.getSelectedProduct(java.lang.String中)   抛出java.lang.Exception映射。在   org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:176)     在   org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:148)     在   org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:109)     在   org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:89)     在   org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:163)     在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)     在   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)     ......还有21个

1 个答案:

答案 0 :(得分:0)

当您的堆栈跟踪显示您发现了#34;不明确的映射。无法映射' xyz'豆法公共" "已经有人员服务' bean方法"因为我猜你的两个@RequestMapping网址是相同的。