您的位置:首页 > 编程语言 > Java开发

异常总结,持续更新

2015-12-03 17:48 501 查看
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中注入后声明的对象时具体类的才出错,应该是声明抽象类的对象
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  spring