1. 问题描述
...
Error creating bean with name 'A': Injection of resource fields failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [IA] is defined: Unsatisfied dependency of type [interface IA]:
expected at least 1 matching bean
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:292)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:959)
本地环境和测试环境部署都没问题,发到线上预发环境启动报错,看异常是因为没有找到bean的定义,但是由于只有预发环境才这样,所以没怀疑bean的定义,再加上之前操作了一些spring依赖的东西,所以只觉得可能是spring的依赖问题。导致2个小时没有找到原因。后来同事提醒是不是配置文件的问题,有没有配置文件在线上不一样。突然想起,线上不同机房的spring配置不一样。。。恍然大悟。。。
2. 问题解决
因为当前代码是只适应机房A的配置,如果想在机房B做预发,需要修改配置文件。这样看来,确实跟异常反映的原因一样,就是没有bean的配置。想当然的经验害人啊。
更多此类问题可参考:
http://blog.csdn.net/free4294/article/details/38706569
分享到:
相关推荐
Foundstone may make improvements and/or changes to the Terms or the<br>website at any time without notice.<br><br>7.5.<br>The failure of Foundstone to enforce or exercise any right or provision of ...
spring-framework-4.3.6.RELEASE - 解包大小为 44.9 MB ## Spring Framework The Spring Framework provides a comprehensive programming and configuration model for modern Java-based enterprise applications ...
<br>}<br></script><br></head><br><body><br><form id="form1" runat="server"><br><asp:ScriptManager ID="ScriptManager1" runat="server"><br><Services><br><asp:ServiceReference Path="~/WebServices/...
解决web.xml中 <page-encoding>UTF-8</page-encoding>报错。错误提示: cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. One of '{"http:// java.sun....
跨平台(Windows / Linux / macOS)支持测试命令的退出代码安装使用安装: npm install expected-exit-status用法Usage $ expected-exit-status <status> --command <command>Options: --command Execute ...
SN_29500-9_Part_4_Expected_values_for_switches_and_buttons
SN_29500-9_Part_9_Expected_values_for_switches_and_buttons
Discover the key Spring framework-related technology standards such as Spring core, Spring-AOP, Spring data access frameworks, and Spring testing to develop robust Java applications easily and rapidly...
The implementation of stored procedures in MySQL 5.0 a huge<br/>milestone -- one that is expected to lead to widespread enterprise adoption of<br/>the already extremely popular MySQL database....
Expected< int> intRef (k); k = 1 ; assert (*intRef == 1 ); 整个实现在libExpected命名空间中。 与CMake集成 add_subdirectory (third-party/lib-expected) target_link_libraries (your-target PRIVATE lib-...
This is a patch file to fix the bugs of EditPlus v2.31<br><br>Copyright © 1998-2007 ES-Computing<br>Contact: support@editplus.com<br>Homepage: http://www.editplus.com/<br><br>INSTALLATION<br>========...
csv-file-processor-spring-...data.csv :具有有效格式的默认示例文件,该文件有 245.000 行test-expected-data.csv:用于比较单元测试的有效输出test-input-data.csv:包含 10 行的小样本文件,用作单元测试的输入
检查TypeScript定义 JavaScript开源库中的.d.ts TypeScript定义的单元测试。 对于非TypeScript项目很有用,该项目希望为TypeScript用户... on < Events> ( 'set' , 2 ) // Positive test: test/index.types.ts impo
Semiparametric GARCH models with long memory applied to value-at-risk and expected shortfall.xdf
注释片段 annotate-snippets是一个... | -------------- expected `Option<String>` because of return type 52 | / for ann in annotations { 53 | | match (ann.range.0, ann.range.1) { 54 | | (None, None) => con
英文版<br>===================================================<br> Pro LINQ: Language Integrated Query in C# 2008 (c) by Apress<br><br> The type of the release is: eBook<br> In the PDF format with ISBN...
Im know the commenting on the source leaves some to <br/>be expected, but i‘ve run low on time.<br/><br/>If you need help, source code to the librarys, or anything else email me at:<br/>logix@ionet...
> 1+2 3 > (1-2)*3 -3 > ans+6 3 > (3+3( Unexpected token "undefined", expected a number, parenthesis, function or constant. > |cos(pi)-sin(pi/2)|^2 4 有关所有可用的数学语法和函数,请仔细查看文档: 用户...
Current release v3.0.0.0 (Oct 28, 2007)<br>in version v3.0.0.0<br><br>- New : support for C++Builder 2007(支持C++ Builder 2007)<br>- New : asynchronous events added to almost all controls....