异常总结,持续更新
2015-12-03 17:48
501 查看
1,spring:
原因是实体类中所对应的属性值都要使用包装类,因为包装类为空的情况下,默认值为null,这说明hibernate中的实体属性都要使用包装类
2,
如果是在web.xml文件中配置的Spring。可能是
中间的单词出错
,3,ssh整合中
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘qjtAction’ defined in file [C:\apache-tomcat-7.0.26\webapps\QingJia\WEB-INF\classes\cn\hp\action\QjtAction.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [cn.hp.action.QjtAction]: Constructor threw exception; nested exception is java.lang.NullPointerException
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [cn.hp.action.QjtAction]: Constructor threw exception; nested exception is java.lang.NullPointerException
有可能是在action类中使用的实体类没有空的构造函数
4,org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named ‘empbiz’ must be of type [cn.hp.biz.EmpBizImpl], but was actually of type [$Proxy27]
这种一直提醒说是注入的bean有问题,因为在action中注入后声明的对象时具体类的才出错,应该是声明抽象类的对象
org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of cn.hp.entity.Emp.comm
原因是实体类中所对应的属性值都要使用包装类,因为包装类为空的情况下,默认值为null,这说明hibernate中的实体属性都要使用包装类
2,
BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
如果是在web.xml文件中配置的Spring。可能是
<description>SpringConfig</description> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param>
中间的单词出错
,3,ssh整合中
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘qjtAction’ defined in file [C:\apache-tomcat-7.0.26\webapps\QingJia\WEB-INF\classes\cn\hp\action\QjtAction.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [cn.hp.action.QjtAction]: Constructor threw exception; nested exception is java.lang.NullPointerException
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [cn.hp.action.QjtAction]: Constructor threw exception; nested exception is java.lang.NullPointerException
有可能是在action类中使用的实体类没有空的构造函数
4,org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named ‘empbiz’ must be of type [cn.hp.biz.EmpBizImpl], but was actually of type [$Proxy27]
这种一直提醒说是注入的bean有问题,因为在action中注入后声明的对象时具体类的才出错,应该是声明抽象类的对象
相关文章推荐
- 一个jar包里的网站
- 一个jar包里的网站之文件上传
- 一个jar包里的网站之返回对媒体类型
- 模拟Spring的简单实现
- spring+html5实现安全传输随机数字密码键盘
- Spring中属性注入详解
- struts2 spring整合fieldError问题
- spring的jdbctemplate的crud的基类dao
- 读取spring配置文件的方法(spring读取资源文件)
- Spring Bean基本管理实例详解
- java实现简单美女拼图游戏
- java基本教程之线程休眠 java多线程教程
- JSP开发中在spring mvc项目中实现登录账号单浏览器登录
- spring boot实战之内嵌容器tomcat配置
- 基于Spring框架的Shiro配置方法
- Spring MVC中上传文件实例
- spring aop两种配置方式
- 实例讲解Java的Spring框架中的AOP实现
- Java的Spring框架的三种连接池的基本用法示例
- 解析Java中如何获取Spring中配置的bean