non-compatible bean definition of same name and class
在整合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的更多相关文章
- 【spring】non-compatible bean definition of same name and class
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected excep tion parsing XML do ...
- [转载]Spring Bean Definition Inheritance
Following is the configuration file Beans.xml where we defined "helloWorld" bean which has ...
- SpringMVC conflicts with existing, non-compatible bean definition of same name and class 的解决办法
问题起因 最近,项目组的里的同事遇到一个问题,他自己负责的模块,SpringMVC的Controller与其他模块的Controller 类名重名了,导致整个工程都起不来了. 后台报的错误是这样的: ...
- Spring错误——Spring 注解——factory-bean reference points back to the same bean definition
背景:学习Spring,在使用注解@Bean的name属性配置<bean>实例时,不能注册实例成功 报错 WARNING: Exception encountered during con ...
- 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 ...
- Spring - Bean Definition Bean定义 给容易提供元数据的3方法
Spring Bean Definition https://www.tutorialspoint.com/spring/spring_bean_definition.htm The objects ...
- Bean Definition从加载、解析、处理、注册到BeanFactory的过程。
为了弄清楚Bean是怎么来的,花费了大把功夫,现在要把Bean Definition的加载.解析.处理.注册到bean工厂的过程记下来.这只是bean definition 的加载.解析.处理.注册过 ...
- No bean class specified on bean definition 解决方案
调试Spring项目出现No bean class specified on bean definition异常 但是控制台并没有给出其他相关信息了 这个时候可以在AbstractBeanDefini ...
- 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: ...
- 曹工说Spring Boot源码系列开讲了(1)-- Bean Definition到底是什么,附spring思维导图分享
写在前面的话&&About me 网上写spring的文章多如牛毛,为什么还要写呢,因为,很简单,那是人家写的:网上都鼓励你不要造轮子,为什么你还要造呢,因为,那不是你造的. 我不是要 ...
随机推荐
- 重启nginx后丢失nginx.pid,如何重新启动nginx
http://blog.csdn.net/llnara/article/details/8691049 一句话结论: /alidata/server/nginx/sbin/nginx -c /alid ...
- jQuery中操作样式
操作行间样式 // 获取div的样式 $("div").css("width"); $("div").css("color&quo ...
- docker从零开始网络(三) overly(覆盖)网络
使用overly网络 该overlay网络驱动程序会创建多个docker进程主机之间的分布式网络.该网络位于(覆盖)特定于主机的网络之上,允许连接到它的容器(包括群集服务容器)安全地进行通信.Dock ...
- [BZOJ2730][HNOI2012]矿场搭建 点双 割点
2730: [HNOI2012]矿场搭建 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 2852 Solved: 1344[Submit][Stat ...
- 山东省第六届省赛 BIGZHUGOD and His Friends II(赛瓦定理)
Description BIGZHUGOD and his three friends are playing a game in a triangle ground. The number of B ...
- SnowNLP:一个处理中文文本的 Python 类库[转]
SnowNLP是一个python写的类库,可以方便的处理中文文本内容,是受到了TextBlob的启发而写的,由于现在大部分的自然语言处理库基本都是针对英文的,于是写了一个方便处理中文的类库,并且和Te ...
- [jquery] 删除文章的时候弹出确认窗口
[<a href="{:U(GROUP_NAME . '/Category/delCate')}/id/{$v.id}" onclick='return del();'> ...
- CSU 1330 字符识别? 【找规律】
你的任务是写一个程序进行字符识别.别担心,你只需要识别1, 2, 3,如下: .*. *** *** .*. ..* ..* .*. *** *** .*. *.. ..* .*. ...
- Android学习--探究服务(二)
服务的基本用法 定义服务: 我们需要先创建服务,我们要使用就的利用一个类去继承它,然后重写它的几个方法,具体的我们看下面的代码: 我们重写了下面三个方法: * onCreate() ...
- scrapy生成csv文件空行、csv文件打开乱码(解决方案)
一.scrapy生成csv文件会有多余的空行 当使用scrapy crawl testspider -o test.csv后,生成的默认csv文件每一行之间是有空行的,解决的方法是修改scrapy的源 ...