Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fundService': Injection of resource dependencies failed;
在进行SSM的Controller的编写, 从浏览器访问后端Controller的时候遇到了这个问题.
这个问题的描述: 创建Bean的对象失败
错误代码如下:
@Service("fundService")
public class FundServiceImpl implements FundService {
@Source
private FundMapper fundMapper;
@Override
public List<Fund> selectAll() {
return fundMapper.selectAll();
}
}
找了很久的问题, 才发现原来是因为新的项目简称为fms, 而原来的项目简称为crm
而在数据库配置的时候, 没有修改
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.bj186.crm.mapper"></property>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
</bean>
解决办法: 将项目名修改, 把crm修改为fms
<!--通过bean配置自动扫描并加载mapper-->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.bj186.fms.mapper"></property>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
</bean>
问题解决!
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fundService': Injection of resource dependencies failed;的更多相关文章
- 【解决方案】 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userHandler': Injection of resource dependencies failed;
一个错误会浪费好多青春绳命 鉴于此,为了不让大家也走弯路,分享解决方案. [错误代码提示] StandardWrapper.Throwableorg.springframework.beans.fac ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'supplierAction': Injection of resource dependencies failed; nested exception is org.springframework.beans.factor
这个错误是因为抽象Action类的时候,把ServletContext写成了serverContext,导致无法注入,正确写法是 import javax.annotation.Resource; i ...
- Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Initialization of bean failed
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'catchFromPBomService': Cannot create inner bean '(inner bean)#302efb82' of type [com.thinkgem.jeesite.modules.fd
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'catchFromPBo ...
- Error creating bean with name 'testController': Injection of resource dependencies failed;
启动ssm项目报错: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 't ...
- Java报错:Error creating bean with name 'testController': Injection of resource dependencies failed
报错如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testCo ...
- ssh整合报错严重: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxx'
错误描述:eclipse整合ssh的时候 报不能创建名字为xxx的对象 信息: Destroying singletons in org.springframework.beans.factory.s ...
- aused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method fai
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'roleDaoImpl' ...
- 严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name
HTTP Status 500 - Servlet.init() for servlet mybatis threw exception type Exception report message S ...
随机推荐
- GROUP BY 子句 和 ORDER BY子句连用注意
ORDER BY一定要放到GROUP BY后面 并且 ORDER BY 里面的字段必须包含在GROUP BY 里面
- ue4 3dui交互相关
1 建立3d ui 新建一个Actor蓝图,上面加上Widget控件,widget Class选择任意ui蓝图,把这个actor蓝图放到场景任意合适位置 2 3dui交互 在合适位置(比如主角的相机上 ...
- Animation Starter Pack中动画蓝图事件添加的位置
可以直接在动画状态机的详情页添加简单事件,跟在动画里添加的通知事件效果一致
- Untiy ShaderLab 随手记录
最基本形式 (先不考虑Fog) Shader "Nafio/TUnlit"{ Properties { _MainTex("TT",2D) = "wh ...
- PJzhang:谷歌在中国大陆可以使用的部分服务
猫宁!!! 参考链接:https://lusongsong.com/reed/170.html https://www.williamlong.info/archives/2124.html http ...
- [WebShow系列] 比赛结果报表导出
操作说明 现场管理员在 浏览器地址栏 输入[现场打分实时展示系统-Web版]的详情排行网址[注:相对网址 /home/rankdshow ] 调用 详情排行. 点击 详情排行榜主题 文字,可以把此排行 ...
- 转 简单聊聊IT软件项目的风险及应对
https://www.jianshu.com/p/b347adca87a6 前言 上段时间在一家演讲俱乐部做即兴演讲主持人,聊的就是风险管理,与会的小伙伴分享了不同行业的风险问题,令人受益匪浅,今天 ...
- 获取spring里的bean
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring. ...
- TestNG ABC
TestNG ABC 资源 官网 :http://testng.org/doc/index.html Maven示例 <dependency> <groupI ...
- ABAP系统字段
SY是一个全局的结构体变量,在词典中已定义过.输入SE11到ABAP字典中. 输入SYST点击显示 附录D 系统字段功能列表 字段名 类型 长度 应用目的 说明 ABCDE CHAR 26 常量 字母 ...