错误提示: IllegalArgumentException occurred calling getter of *
来源:互联网 发布:linux添加管理员权限 编辑:程序博客网 时间:2024/06/10 21:12
主要错误信息:
- IllegalArgumentException in class: com.gdcy.bean.Department, getter method of property: id
org.springframework.orm.hibernate3.HibernateSystemException:IllegalArgumentException occurred calling getter of com.gdcy.bean.Department.id; nested exception isorg.hibernate.PropertyAccessException:IllegalArgumentException occurred calling getter of com.gdcy.bean.Department.id
Caused by: org.hibernate.PropertyAccessException:IllegalArgumentException occurred calling getter of com.gdcy.bean.Department.id
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
产生错误原因:映射文件中Department.id的类型不匹配
造成经过:在制作项目中,因为贪方便,Department外键对象使用了String类型,打算只读取它的ID来使用就算了,但又糊涂的在配置文件中设置了<many-to-one>的关系,结果在匹配类型的时候成了Department对象和String对象,因此匹配出错,提示类型不匹配
解决方法:1修改hbm.xml文件的多对一,2bean文件中改回读取Department对象
Orther:以上犯的错误比较特殊,常见的:A表中id为int类型,却在A的bean中将id设置为了String,也会导致上述错误(即java类字段的类型与表字段的类型/长度不一致)
- 错误提示: IllegalArgumentException occurred calling getter of *
- 错误解决:IllegalArgumentException occurred calling getter of *
- 解决错误IllegalArgumentException occurred calling getter of cn.chengtech.ms.common.entity.BaseModel.id
- org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of org.catablog.entity.IdEntity.entityId
- IllegalArgumentException occurred while calling setter of
- IllegalArgumentException occurred while calling setter of
- IllegalArgumentException occurred while calling setter of
- IllegalArgumentException occurred while calling
- org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of
- 【hibernate映射问题】IllegalArgumentException occurred while calling setter of
- org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com
- Struts问题: IllegalArgumentException occurred while calling setter of com.zzuli.
- occurred while calling setter of ......的错误
- Exception in thread "main" org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of
- IllegalArgumentException occurred while calling setter of com.shxt.bo.Course.cid
- hibernate 的many to one 的问题IllegalArgumentException occurred while calling setter of hibernatePOJO
- Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling se
- 关于occurred while calling setter of com.pb.entity.House.housePictures的异常错误
- AltiumDesigner中从PCB文件更新SCH文件元件标号--PCB自动标号
- 解决修复本地连接失败无法取消的问题
- 使用拦截器来拦截请求handlerInterceptor
- 防止重复提交方法
- Python 上下文管理器 可自定义
- 错误提示: IllegalArgumentException occurred calling getter of *
- 安装及使用Eclipse Maven插件的经验
- Python 下文管理器
- 130725hdu杭电多校第二场解题报告
- android:layout_marginLeft 与 android:layout_paddingLeft 的区别
- ASIHTTPRequest和ASINetworkQueue实现队列下载并查看结果
- java 获得某月的第一天和最后一天
- PHP网页超时
- struts 2的文件上传