- 浏览: 79215 次
- 性别:
- 来自: 厦门
文章分类
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 1561(1)just change the logging leve ... -
hibernate配置二级缓存出现的问题
2012-10-14 22:07 1080(1)解决方案:少了commons-logging-1 ... -
org.dbunit.dataset.NoSuchColumnException:xxx.xxx
2012-08-29 10:56 1027hibernate 配置文件 <?xml versi ... -
org.apache.jasper.JasperException: Unable to compile class for JSP:
2012-08-21 22:50 7361转至:http://saber5d.blog.163.com/ ... -
Batch update returned unexpected row count from update [0]
2012-08-21 16:01 17335转至:http://www.cnblogs.com/By ... -
org.springframework.beans.factory.BeanCreationException
2012-08-20 17:25 1353org.springframework.beans.facto ... -
org.apache.catalina.LifecycleException: Failed to start component
2012-07-20 12:15 1322org.apache.catalina.LifecycleEx ... -
java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-base
2012-07-17 10:59 681原因: 1.参数用“?”时 ,周围不能加单引号,否则被当作字 ... -
java.lang.RuntimeException: Invalid action class configuration that references a
2012-06-23 21:07 2726今天突然发现此异常。网上找了下,有很多原因就集合下。 ... -
Communications link failure due to underlying exception
2012-06-13 14:21 1437数据库为Mysql,当登录网站操作时出现以下异常信息: ... -
java.lang.OutOfMemoryError: Java heap space
2012-03-22 16:24 1176java.lang.OutOfMemoryError: Ja ... -
javax.el.PropertyNotFoundException: Property 'xxx' not found on type String
2012-03-16 18:10 1510<tag:forEach var="cu ...
相关推荐
最近在使用python过重遇到这个问题,NameError: name 'xxx' is not defined,在学习python或者在使用python的过程中这个问题大家肯定都遇到过,在这里我就这个问题总结以下几种情况: 错误NameError: name ‘xxx’ ...
在尝试运行某个先前版本的示例项目(dome)时,开发者遇到了一个错误提示:“Type com.lfk.justweengine.BuildConfig.class is defined multiple times”。这个错误意味着系统在编译或运行时发现了相同的类定义,...
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...
在IT领域,尤其是在Web开发中,遇到“No result defined for action”这类错误是常见的问题,尤其当使用Struts2框架时更为突出。此类错误通常指向在控制器(Action)中未正确配置或实现结果集(Result),导致请求...
如果你遇到了"luckysheet is not defined"的错误,这通常意味着在你的Vue项目中,Luckysheet未正确安装或引入。下面我们将详细探讨这个问题的解决方案以及如何在Vue项目中有效地使用Luckysheet。 首先,让我们了解...
在某些情况下,当你尝试使用`execjs`执行包含浏览器环境特定对象(如`document`或`window`)的JavaScript代码时,可能会遇到`execjs._exceptions.ProgramError`,比如`ReferenceError: document is not defined`或`...
"A bean with that name has already been defined and overriding is disabled."意味着Spring容器中已经存在一个与‘xxx.FeignClientSpecification’相同名称的Bean,并且新版本中禁止了Bean定义的覆盖。...
ReferenceError: AMap is not defined AMap未定义
会话 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 ...
### SELinux权限问题详解:Service ro_isn 需要定义 SELinux Domain #### 一、背景介绍 在安卓系统中,为了确保系统的安全性与稳定性,SELinux(Security Enhanced Linux)作为一种强制访问控制机制被广泛采用。当...
### Struts2框架中“No result defined for action and result input”错误解析及解决方法 #### 错误概述 在Struts2框架中开发Web应用程序时,可能会遇到一个名为“No result defined for action and result input...
#### 错误三:The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (28.0.2) for Android Gradle Plugin 3.2.0. **问题描述**:指定的Build Tools...
在Hadoop分布式文件系统(HDFS)的运行过程中,可能会遇到一个常见的错误,即"ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation. Starting datanodes"。这个错误通常意味着系统在尝试启动...
在项目下执行如下命令 ...报如下图错误 解决办法: ...文档里说: 所以我命通过命令安装扩展: ...composer require topthink/think-multi-app 出现如下图说明安装成功了 ...Successed 出现这个说明大功告成,可以开始你的多...
### "Value too large for defined data type" 解决办法 在Linux环境下进行文件操作时,可能会遇到一个名为“Value too large for defined data type”的错误。这一问题通常发生在使用`ls`或`find`命令来查看大于2...
+ New type of event was defined: TDBGridEhFillSTFilterListValuesEvent = procedure(Sender: TCustomDBGridEh; Column: TColumnEh; Items: TStrings; var Processed: Boolean) of object; The event of this...