在整合struts2.1.6+spring2.5.6开发中,使用了注解和struts-convention来实现零配置管理。spring也使用注解annotation方式。现在的问题是:我在连个个不同package中有两个相同名称的类,只是类所在的目录不同。例如在 com.idearsoft.idear.module.SystemMaintain.action下有个HomeAction.java,在 com.idearsoft.idear.module.Main.action也有一个HomeAction.java。在应用服务器启动时总是提示这两个homeAction 冲突。

回答:

spring管理bean大概类似把bean实例化放到map中,它会以配置的id和name(如果配置的话)
为key存放起来,2个一样的肯定要冲突,应该给他们换个名字就成啦
controller("systemHomeAction")
controller("moduleHomeAction")

在注解后面换上个名字eg:@service("roleService")

配置实例的时候名字不能一样

non-compatible bean definition of same name and class的更多相关文章

  1. 【spring】non-compatible bean definition of same name and class

    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected excep tion parsing XML do ...

  2. [转载]Spring Bean Definition Inheritance

    Following is the configuration file Beans.xml where we defined "helloWorld" bean which has ...

  3. SpringMVC conflicts with existing, non-compatible bean definition of same name and class 的解决办法

    问题起因 最近,项目组的里的同事遇到一个问题,他自己负责的模块,SpringMVC的Controller与其他模块的Controller 类名重名了,导致整个工程都起不来了. 后台报的错误是这样的: ...

  4. Spring错误——Spring 注解——factory-bean reference points back to the same bean definition

    背景:学习Spring,在使用注解@Bean的name属性配置<bean>实例时,不能注册实例成功 报错 WARNING: Exception encountered during con ...

  5. org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unexpected failure during bean definition parsing Offending resource: class path resource [applicationC

    这个错误是 org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration proble ...

  6. Spring - Bean Definition Bean定义 给容易提供元数据的3方法

    Spring Bean Definition https://www.tutorialspoint.com/spring/spring_bean_definition.htm The objects ...

  7. Bean Definition从加载、解析、处理、注册到BeanFactory的过程。

    为了弄清楚Bean是怎么来的,花费了大把功夫,现在要把Bean Definition的加载.解析.处理.注册到bean工厂的过程记下来.这只是bean definition 的加载.解析.处理.注册过 ...

  8. No bean class specified on bean definition 解决方案

    调试Spring项目出现No bean class specified on bean definition异常 但是控制台并没有给出其他相关信息了 这个时候可以在AbstractBeanDefini ...

  9. spring 'arroudAspect' for bean class [com.dw.test.ArroudAspect] conflicts with existing, non-compatible bean definition of same name and class [com.dw.aspect.ArroudAspect]

    Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: ...

  10. 曹工说Spring Boot源码系列开讲了(1)-- Bean Definition到底是什么,附spring思维导图分享

    写在前面的话&&About me 网上写spring的文章多如牛毛,为什么还要写呢,因为,很简单,那是人家写的:网上都鼓励你不要造轮子,为什么你还要造呢,因为,那不是你造的. 我不是要 ...

随机推荐

  1. Linux下mysql命令 导入 导出sql文件

    导出数据库 直接使用命令: mysqldump -u root -p abc >abc.sql 然后回车输入密码就可以了: mysqldump -u 数据库链接用户名 -p  目标数据库 > ...

  2. maven修改本地仓库默认路径问题

    找到maven本地路径的settings.xml文件,如D:\Program Files\apache-maven-3.0.5\conf\settings.xml: 在settings.xml文件中增 ...

  3. codevs 1085

    数字游戏 2003年NOIP全国联赛普及组 时间限制: s 空间限制: KB 题目等级 : 黄金 Gold 题解 题目描述 Description 丁丁最近沉迷于一个数字游戏之中.这个游戏看似简单,但 ...

  4. 2017/3/7 值得"纪念"的错误

    使用viewpager和fragment做个能左右滑动的效果,结果怎么弄怎么有问题,先是怀疑什么viewPager维护刷新内部fragment什么的,又是在FragmentPageAdapter的ge ...

  5. Vue cmd命令操作

    1.安装node(安装到电脑中,不同项目不需重复安装) 安装nodejs(如果不是在C:则需要配环境变量)2.打开cmd C:创建一个文件夹(名字不要用node) 1.进入该文件夹 2.node -v ...

  6. Storm学习中遇到的问题整理

    在编写storm代码来进行实时分析的时候遇到了一些问题,有些的确令人比较头痛,现在稍微做一下整理.数据流向(本地-Spout-Bolt-Hdfs) 1数据的输入输出文件的路径选择 因为在此项目中数据是 ...

  7. Android学习--还有一些小技巧

    这些小技巧 通过上面的这些文章,就把简单的安卓项目总结了一遍,当然你说懂这些就可以做Android开发的话还是不行的,欠缺的还有很多,但欠缺的这些我们有只能在工作中去总结以及不断的提高,这篇文章我们还 ...

  8. 6、Django实战第6天:用户登录

    今天开始,我们需要来写后台逻辑了.... 后台逻辑代码都是编写在views.py文件里面,今天要完成的登录功能,因此来编辑users.views.py 这里我们根据请求方法来判断分为2种情况,网页默认 ...

  9. HDOJ 5385 The path

    Dicription You have a connected directed graph.Let $d(x)$ be the length of the shortest path from $1 ...

  10. Linux下使用xargs得到字符串作为参数进行输出、awk得到字符串作为参数进行输出

    背景: cat test.txt 实例: 1.xargs cat test.txt | xargs -i echo {} cat test.txt | xargs -I {} echo {} 大小写i ...