异常总结,持续更新

来源:互联网 发布:mac微信语音导出软件 编辑:程序博客网 时间:2024/05/01 15:23

1,spring

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中注入后声明的对象时具体类的才出错,应该是声明抽象类的对象

0 0
原创粉丝点击