当前位置: 代码迷 >> Web开发 >> org.hibernate.PropertyAccessException: Null value was assigned to a property of解决办法
  详细解决方案

org.hibernate.PropertyAccessException: Null value was assigned to a property of解决办法

热度:2151   发布时间:2014-03-01 00:37:03.0
org.hibernate.PropertyAccessException: Null value was assigned to a property of
HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.shjob.hibernate.vo.InUser.clicks
org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:109)
org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:352)
org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:232)
org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3580)
org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:152)
org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:877)
org.hibernate.loader.Loader.doQuery(Loader.java:752)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
org.hibernate.loader.Loader.doList(Loader.java:2232)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
org.hibernate.loader.Loader.list(Loader.java:2124)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
com.shjob.hibernate.impl.InUserDAOImpl.findByAc(InUserDAOImpl.java:49)
com.shjob.struts.form.LoginForm.validate(LoginForm.java:84)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:950)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.shjob.filter.EncodingFilter.doFilter(EncodingFilter.java:22)


root cause 

java.lang.IllegalArgumentException
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:66)
org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:352)
org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:232)
org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3580)
org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:152)
org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:877)
org.hibernate.loader.Loader.doQuery(Loader.java:752)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
org.hibernate.loader.Loader.doList(Loader.java:2232)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
org.hibernate.loader.Loader.list(Loader.java:2124)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
com.shjob.hibernate.impl.InUserDAOImpl.findByAc(InUserDAOImpl.java:49)
com.shjob.struts.form.LoginForm.validate(LoginForm.java:84)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:950)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.shjob.filter.EncodingFilter.doFilter(EncodingFilter.java:22)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.

本帖最后由 net_lover 于 2011-07-11 22:42:45 编辑
有个字段需要赋值,而你没有赋值或者赋值为Null 导致的 clicks
  相关解决方案