高分求getHibernateTemplate().find问题解答
在执行getHibernateTemplate().find("from role")查询时报出以下错误?请问各位是为什么?如何解决呀? 谢谢!
ERROR [http-8080-Processor22] ActionExceptionHandler.logException(148) | org.springframework.orm.hibernate3.HibernateSystemException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.lily.dap.model.right.Role.setRoles; nested exception is org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.lily.dap.model.right.Role.setRoles
org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.lily.dap.model.right.Role.setRoles
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer
///////////////////////////
因为错误太长中间省略一部分
//////////////////////////
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Caused by: net.sf.cglib.beans.BulkBeanException
at com.lily.dap.model.right.Role$$BulkBeanByCGLIB$$b82d98e6.setPropertyValues(<generated>)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:212)
... 98 more
Caused by: java.lang.ClassCastException
... 100 more
问题点数:100、回复次数:2Top
1 楼yxhzj(余华[学习J2EE中])回复于 2006-03-03 09:39:22 得分 0
数据库的值和javabean对象不统一
hibernate映射文件设置,不为空
在数据库里的数据却为空
一般是这种原因
com.lily.dap.model.right.Role.setRoles
这个方法你看看Top
2 楼wafer_w(流浪的风)回复于 2006-03-03 17:52:14 得分 0
只有find方法失败还是所有方法都失败?
看看pojo类和xml文件是否一致,最好是自动生成的,避免出错Top




