there is already 'RtController' bean method 项目报错
今天开发项目时候发现项目报错启动的时候,也没有具体指的是哪一行报错,其实很简单的知道,首先看下报错信息:
there is already 'RtController' bean method
public void com.yd.ydbi.matrix.controller.Matrix_cross_sort_toSiteRtController.exportFnbEntities1(com.common.response.CustomReqParameter,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception mapped.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory$.getObject(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:)
at javax.servlet.GenericServlet.init(GenericServlet.java:)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'matrix_cross_sort_toSiteRtController' method
public void com.matrix.controller.RtController.exportFnbEntities(com.response.CustomReqParameter,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception
to {[/actions/exportFnbEntities]}: There is already 'RtController' bean method
public void com.controller.RtController.exportFnbEntities1(com.response.CustomReqParameter,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception mapped.
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.assertUniqueMethodMapping(AbstractHandlerMethodMapping.java:)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.register(AbstractHandlerMethodMapping.java:)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:)
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:)
... more
这个错其实可以很简单的看出来,前提是了解springmvc的原理,
springmvc在初始化的时候,就会将url跟相应的method形成一个map集合,让url和对应method,同时这个url和method是不可以重复的,所以就会存在相关问题,
上面报错信息说是这个原因,是用相同的method,所以在启动时候就会报错,所以我们需要去对应的controller中寻找相关的错误信息,就是比较controller中数据是否有相关信息,
就是比较
@requestMapping中参数和method名称和其他的@requestMapping和method是否有相同的,今天我直接在里面寻找到了,主要是优化别人的项目,.所以方法名意向之中写成相同的了
there is already 'RtController' bean method 项目报错的更多相关文章
- myeclipse 10 载入新的项目报错Cannot return from outside a function or method
myeclipse 10 载入新的项目报错Cannot return from outside a function or method 解决方法: 方法一: window -->prefere ...
- 运行springboot项目报错:Field userMapper in XX required a bean of type 'xx' that could not be found.
运行springboot项目报错: *************************** APPLICATION FAILED TO START ************************** ...
- 解决:启动项目报错 java.lang.UnsatisfiedLinkError: D:\Java\apache-tomcat-8.0.17\bin\tcnative-1.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
启动项目报错如下: java.lang.UnsatisfiedLinkError: D:\Java\apache-tomcat-8.0.17\bin\tcnative-1.dll: Can't loa ...
- 启动项目报错:org.springframework.beans.factory.UnsatisfiedDependencyException
dubbo项目: 启动项目报错:(web端) org.springframework.beans.factory.UnsatisfiedDependencyException: Error creat ...
- tomcat7 启动项目报错 java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig()
JDK版本:jdk1.8.0_77 Tomcat 版本:apache-tomcat-7.0.47 异常重现步骤: 1.完成项目部署 2.启动Tomcat 异常头部信息:java.lang.NoSuch ...
- STS新建的maven项目报错问题
STS新建的maven项目报错问题 解决方法:打开pom.xml文件添加 <dependency> <groupId>javax.servlet</groupId> ...
- jacob 多个web项目报错 jacob-1.14.3-x64.dll already loaded in another classloader jacob
多个web项目报错 jacob-1.14.3-x64.dll already loaded in another classloader jacob 这个问题困扰了很久,网上很多解决方案,很多都不成功 ...
- 项目报错,tomcat中引起
1.项目报错,但发现工程并没有错.此刻错误应该定位如下,即工程里面引用的jar可能有错,可能是路劲变了....
- eclipse发布项目报错:Multiple Contexts hava a path of “/xxx“
你的位置:首页 > Java编程 > eclipse发布项目报错:Multiple Contexts hava a path of “/xxx“ eclipse发布项目报错:Multipl ...
随机推荐
- spring不能注入静态变量的原因
静态方法是属于类(class)的,普通方法才是属于实体对象(也就是New出来的对象)的,spring注入是在容器中实例化对象,所以不能使用静态方法. @Autowired private static ...
- elasticsearch2.x插件之一:kopf
kopf kopf is a simple web administration tool for elasticsearch written in JavaScript + AngularJS + ...
- sed 之 & 符号
sed 之 & 符号 摘自:https://blog.csdn.net/jasonliujintao/article/details/53509620 & 这个符号,其实很有用,在对相 ...
- 关于"人工智能Python""系统环境变量设置步骤
最近无论是JAVA的环境变量配置,还是Python环境变量配置都有学生问我,我在这里写一下回答,当然我以配置Python的环境变脸来举例.首先需要确定本机电脑上安装上了Python 首先解释一下为什么 ...
- Android onKeyDown、onKeyUp、dispatchKeyEvent的区别
1. onKeyDown.onKeyUp.dispatchKeyEvent的区别和使用场景 区别: 1.1 onKeyDown.onKeyUp是按键事件的回调接口(冒泡式调用),dispatchKey ...
- Java主线程如何等待子线程执行结束(转)
工作中往往会遇到异步去执行某段逻辑, 然后先处理其他事情, 处理完后再把那段逻辑的处理结果进行汇总的产景, 这时候就需要使用线程了. 一个线程启动之后, 是异步的去执行需要执行的内容的, 不会影响主线 ...
- C# web通信解决方案
1.Socket 2.Socket and websocket(HTML5) 3.SignalR 一,简介 Signal 是微软支持的一个运行在 Dot NET 平台上的 html websocket ...
- 將sql server 2008R2 Max memory 意外設為0
做sql server 內存Max memory 設定時大意,誤把最大值設為0,怎麼著都連不上DataBase,哪真叫個急呀,最後還是看到一條文命令把救回來了,其它很簡單急的時候就是沒想出來. 1.暫 ...
- 百度UEditor富文本编辑器去除自动追加p标签
本篇文章还原了我在遇到这个问题时的解决过程: 找到ueditor.all.js文件,搜索 me.addInputRule(function(root){ 或者直接搜索 //进入编辑器的li要套p标签 ...
- C# ADO.NET+反射读取数据库并转换为List
public List<T> QueryByADO<T>(string connStr, string sql) where T : class, new() { using ...