org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.hiber
来源:互联网 发布:打谱软件muse用法 编辑:程序博客网 时间:2024/06/05 03:06
spring 错误:org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.hibernate.SessionFactory] found for dependency:
在做sshe整合测试的时候,测到hibernate整合spring的时候出现上面的错误,错误原因就是sessionfactory没有注入进来所以报错
原因如下:ApplicationContext ac = newClassPathXmlApplicationContext("classpath:spring.xml","classpath:spring-hibernate.xml");
UserServiceI userService = (UserServiceI) ac.getBean("userService");
UserDao userDao = (UserDao) ac.getBean("userDao");
System.out.println("ac"+ac);
Tuser tuser = new Tuser();
tuser.setId(UUID.randomUUID().toString());
tuser.setName("ac");
tuser.setPwd("aaaaa");
userService.save(tuser);
开始的时候只写了spring.xml后面的没写,没写当然不可能注入sessionfactory了,这个错误真心不该犯啊
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.hiber
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.serv
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.act
- Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.wei
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.itca
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.cui
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.lin
- shiro错误 org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.yuanv.b
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean nam
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named is defined
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager'
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xxxxx' i
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilter
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilter
- Java多线程--同步与死锁:synchronized;等待与唤醒:wait、notify、notifyAll;生命周期
- SSD定期做Secure Erase
- KIS科目初始数据录入
- 编程ING人人都能学会程序设计
- vs2010中opengl环境配置
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [org.hiber
- 解读微信与中国移动信令之争
- 关于$(' ',this)==?
- 程序开发语言排名
- jQuery权威指南(第2版)
- 字符集
- 感冒治疗方法
- Tcp协议三次握手流程_world
- Android常用的工具类