- 浏览: 76901 次
- 性别:
- 来自: 厦门
文章分类
No unique bean of type [com.xxx.service.Ixxx] is defined: expected single matchi
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.xxx.service.impl.TestxxxImpl': Unsatisfied dependency expressed through bean property 'xxx': : No unique bean of type [com.xxx.service.Ixxx] is defined: expected single matching bean but found 2: [xxxImpl, xxx]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.xxx.service.Ixxx] is defined: expected single matching bean but found 2: [xxxImpl, xxx] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1167) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1059) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:374) at org.springframework.test.AbstractDependencyInjectionSpringContextTests.injectDependencies(AbstractDependencyInjectionSpringContextTests.java:208) at org.springframework.test.AbstractDependencyInjectionSpringContextTests.prepareTestInstance(AbstractDependencyInjectionSpringContextTests.java:183) at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:103) at junit.framework.TestCase.runBare(TestCase.java:128) at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:79) at com.comwave.core.test.BaseDBTestCase.runBare(BaseDBTestCase.java:70) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.xxx.service.Ixxx] is defined: expected single matching bean but found 2: [xxxImpl, xxx] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:796) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1152) ... 20 more
原因:
1.註解中有加,配置文件又有加bean,所以就出現兩個了
2.spring dbunit
public class TestxxxImpl { protected Ixxx xxx; //(1)xxx的setter方法 }
(2)配置中有加bean ,所以就出現兩個了
发表评论
-
javax.crypto.BadPaddingException: Data must start with zero
2013-04-08 16:24 0INFO [localhost-startStop-1] [ ... -
ognl.MethodFailedException: Method "setXxx" failed for object 集結
2012-10-15 11:45 1519(1)just change the logging leve ... -
hibernate配置二级缓存出现的问题
2012-10-14 22:07 1041(1)解决方案:少了commons-logging-1 ... -
org.dbunit.dataset.NoSuchColumnException:xxx.xxx
2012-08-29 10:56 986hibernate 配置文件 <?xml versi ... -
org.apache.jasper.JasperException: Unable to compile class for JSP:
2012-08-21 22:50 7314转至:http://saber5d.blog.163.com/ ... -
Batch update returned unexpected row count from update [0]
2012-08-21 16:01 17290转至:http://www.cnblogs.com/By ... -
org.springframework.beans.factory.BeanCreationException
2012-08-20 17:25 1273org.springframework.beans.facto ... -
org.apache.catalina.LifecycleException: Failed to start component
2012-07-20 12:15 1271org.apache.catalina.LifecycleEx ... -
java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-base
2012-07-17 10:59 638原因: 1.参数用“?”时 ,周围不能加单引号,否则被当作字 ... -
java.lang.RuntimeException: Invalid action class configuration that references a
2012-06-23 21:07 2640今天突然发现此异常。网上找了下,有很多原因就集合下。 ... -
Communications link failure due to underlying exception
2012-06-13 14:21 1417数据库为Mysql,当登录网站操作时出现以下异常信息: ... -
java.lang.OutOfMemoryError: Java heap space
2012-03-22 16:24 1108java.lang.OutOfMemoryError: Ja ... -
javax.el.PropertyNotFoundException: Property 'xxx' not found on type String
2012-03-16 18:10 1463<tag:forEach var="cu ...
相关推荐
在运行之前版本的dome时遇到一个问题: Type com.lfk.justweengine.BuildConfig.class is defined multiple times 在此记录一下解决方法。 原因:module 的名字相同引发的错误
最近在使用python过重遇到这个问题,NameError: name 'xxx' is not defined,在学习python或者在使用python的过程中这个问题大家肯定都遇到过,在这里我就这个问题总结以下几种情况: 错误NameError: name ‘xxx’ ...
docker run –rm –name “complie-test” –network=host -v /home/test:/build reg.docker.xxx.xxx:1.0 bash -c “cd /build/docker && sh build.sh” 结果报错为: flag provided but not defined:–network 从...
但是在项目经过本地测试没有任何问题,打包上线后却会报错 webpackJsonp is not defined。这是因为公共文件必须在自己引用的js文件之前引用。 可以手动改文件引用,但是推荐以下解决办法: 找到build→webpack.prod...
Error creating bean with name 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0' defined in ServletContext resource [/WEB-INF/springMVC-servlet.xml]: Initialization of bean failed;...
<link rel="stylesheet" type="text/css" href="style.css"> src="http://ditu.google.com/maps?file=api&v=2& key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ- i1QfUnH94QxWIa6N4U6...
No result defined for action.doc
今天用execjs调用JS时,发现报错execjs._exceptions.ProgramError: ReferenceError: document is not defined 如图: 错误类型:文档对象未定义,解决方法,定义对象即可,习惯性定义变量嘛 var document ;? ...
会话 Session: A unique invocation of Aeron that identifies a single Publication and all Subscriptions for that Publication.会话ID Session ID: A unique identifier for a Session.频道 Channel: A ...
ReferenceError: AMap is not defined AMap未定义
其中一个问题是报but there is no HDFS_NAMENODE_USER defined. Aborting operation. Starting datanodes 直接解决 在Hadoop安装目录下找到sbin文件夹 在里面修改四个文件 1、对于start-dfs.sh和stop-dfs.sh文件,...
A bean with that name has already been defined and overriding is disabled. 版本信息 升级前版本 SpringBoot SpringCloud 2.0.6.RELEASE Finchley.SR2 升级后版本 SpringBoot SpringCloud 2.2.5....
17.1.2 Core Framework Usage of the Naming Service 335 17.1.3 Application Usage of the Naming Service 336 17.2 Event Service 336 17.2.1 Core Framework Usage of the Event Service 349 17.2.2 Resource ...
jsp\No result defined for action and result input.doc
Acknowledgements..................................................................................................................xxx Chapter 1: Introduction to SystemVerilog.............................
+ New type of event was defined: TDBGridEhFillSTFilterListValuesEvent = procedure(Sender: TCustomDBGridEh; Column: TColumnEh; Items: TStrings; var Processed: Boolean) of object; The event of this...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customAreaService' defined in class path resource [applicationContext.xml]: Initialization of bean failed;...
luckysheet源码包
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested ...