错误org.hibernate.PropertyAccessException: Null value was assigned to a property of的解决方法

出现org.hibernate.PropertyAccessException: Null value was assigned to a property of...错误时,是因为数据库中表字段对应的数据与该字段的数据类型不一致导致的,比如表字段的数据类型为float,而数据为NULL,就是这样子数据类型不一致才会导致这个错误

解决方法:把实际数据的数据类型和表字段的数据类型调整成数据类型一样的即可。

转载地址:https://blog.csdn.net/chenyuangege/article/details/50180313

org.hibernate.PropertyAccessException: Null value was assigned to a property of

07-11

HTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.shjob.hibernate.vo.InUser.clicksrn org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:109)rn org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:352)rn org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:232)rn org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3580)rn org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:152)rn org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:877)rn org.hibernate.loader.Loader.doQuery(Loader.java:752)rn org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)rn org.hibernate.loader.Loader.doList(Loader.java:2232)rn org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)rn org.hibernate.loader.Loader.list(Loader.java:2124)rn org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)rn org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)rn org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)rn org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)rn org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)rn com.shjob.hibernate.impl.InUserDAOImpl.findByAc(InUserDAOImpl.java:49)rn com.shjob.struts.form.LoginForm.validate(LoginForm.java:84)rn org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:950)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn com.shjob.filter.EncodingFilter.doFilter(EncodingFilter.java:22)rnrnrnroot cause rnrnjava.lang.IllegalArgumentExceptionrn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:66)rn org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:352)rn org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:232)rn org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3580)rn org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:152)rn org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:877)rn org.hibernate.loader.Loader.doQuery(Loader.java:752)rn org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)rn org.hibernate.loader.Loader.doList(Loader.java:2232)rn org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)rn org.hibernate.loader.Loader.list(Loader.java:2124)rn org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)rn org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)rn org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)rn org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)rn org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)rn com.shjob.hibernate.impl.InUserDAOImpl.findByAc(InUserDAOImpl.java:49)rn com.shjob.struts.form.LoginForm.validate(LoginForm.java:84)rn org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:950)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn com.shjob.filter.EncodingFilter.doFilter(EncodingFilter.java:22)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.rnrn

org.hibernate.PropertyAccessException: exception setting property value with CGLIB (sethibernate.cglib.use_reflection_optimizer=

10-14

rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnorg.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.ysglobal.empolder.pojo.Material.setOthersrn at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:215)rn at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:185)rn at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3232)rn at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:129)rn at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)rn at org.hibernate.loader.Loader.doQuery(Loader.java:717)rn at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)rn at org.hibernate.loader.Loader.doList(Loader.java:2145)rn at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)rn at org.hibernate.loader.Loader.list(Loader.java:2024)rn at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)rn at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)rn at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)rn at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106)rn at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)rn at com.ysglobal.webframe.dao.AbstractBaseDao.pagedQuery(AbstractBaseDao.java:375)rn at com.ysglobal.empolder.material.manager.MaterialManager.selectMaterial(MaterialManager.java:75)rn at com.ysglobal.empolder.material.web.action.MaterialAction.listMaterialPage(MaterialAction.java:157)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at com.ysglobal.webframe.web.filter.OpenHibernateSessionFilter.doFilter(OpenHibernateSessionFilter.java:38)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at com.ysglobal.webframe.web.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:47)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)rn at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)rn at java.lang.Thread.run(Thread.java:619)rnCaused by: net.sf.cglib.beans.BulkBeanException: com.ysglobal.empolder.pojo.Others cannot be cast to java.util.Setrn at com.ysglobal.empolder.pojo.Material$$BulkBeanByCGLIB$$180c87f0.setPropertyValues()rn at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:212)rn ... 49 morernCaused by: java.lang.ClassCastException: com.ysglobal.empolder.pojo.Others cannot be cast to java.util.Setrn ... 51 morern

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试

关闭