石楠烟斗的雾 2015-05-18 11:40 采纳率: 0%
浏览 3427

一个关于Hibernate的奇葩问题 HibernateSystemException

这是在公司的项目中遇到的问题,很奇怪。它不是每次都出现,有的时候出现,自己尝试解决,可实践了很久都不知道异常的原因。项目使用的是Hibernate+Spring,是客户端程序。具体异常详见:
2015-05-18 19:37:21,288-[TS] ERROR http-bio-8080-exec-4 org.hibernate.property.BasicPropertyAccessor - IllegalArgumentException in class: com.erp.pojo.OaWorkFlow, getter method of property: id
2015-05-18 19:37:21,290-[TS] WARN http-bio-8080-exec-4 org.springframework.remoting.support.RemoteInvocationTraceInterceptor - Processing of HttpInvokerServiceExporter remote call resulted in fatal exception: com.erp.service.RiskReviewService.findCurrentRiskReview
org.springframework.orm.hibernate3.HibernateSystemException: IllegalArgumentException occurred calling getter of com.erp.pojo.OaWorkFlow.id; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.erp.pojo.OaWorkFlow.id

根据异常来看,说是OaWorkFlow类的id没有getter方法,可实际上是有的,这就是我为什么说奇葩的问题。下面是OaWorkFlow代码片段:
图片说明

还请大家驻足帮忙看一看,以前是否有遇到这种问题,谢谢!

  • 写回答

3条回答 默认 最新

  • 毕小宝 领域专家: 后端开发技术领域 2015-05-18 12:05
    关注

    id的类型和它的getter返回值类型可能不是同一种类型。
    建议检查下,统一成一种数据类型。祝好!

    评论

报告相同问题?