Hibernate Troubleshooting

org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.pure.domain.Member.setLogincount
	org.hibernate.tuple.PojoTuplizer.setPropertyValuesWithOptimizer(PojoTuplizer.java:203)

According to error, I found that may be due to the set method is not wrong, checked several times and found nothing wrong, and later the Internet looking for a bit, there are the older generation was also encountered such problems. http://hi.baidu.com/nickshen3/blog/item/0dbbacc2d511701f0ef47727.html
exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer = false for more info) setter of ...
Reason: null query results include figures for some of the items contains null, the definition must be used when the wrapper types, and can not be primitive types, such as the use of Integer and so on, and can not be dished out int otherwise exception!
Solution: map int, double the field, when under construction, some int or double fields default 0, resulting in exception setting property value with CGLIB setter wrong these fields. These fields have default values final. The default value is set up problems can be resolved.
But I found in mapping in peacetime, many people use the wrapper class, so even if there is null value, nor will the problem, but I do not know a good thing to set default values; or direct the use of packaging type, also called upon to Big Brother advice. [size = medium]

org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.pure.domain.Member.setLogincount
	org.hibernate.tuple.PojoTuplizer.setPropertyValuesWithOptimizer(PojoTuplizer.java:203)
	org.hibernate.tuple.PojoTuplizer.setPropertyValues(PojoTuplizer.java:173)
	org.hibernate.persister.entity.BasicEntityPersister.setPropertyValues(BasicEntityPersister.java:2919)
	org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113)
	org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:530)
	org.hibernate.loader.Loader.doQuery(Loader.java:436)
	org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
	org.hibernate.loader.Loader.doList(Loader.java:1593)
	org.hibernate.loader.Loader.list(Loader.java:1577)
	org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
	org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
	org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
	org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
	com.pure.dao.hibernate.MemberHibernateDAO$2.doInHibernate(MemberHibernateDAO.java:60)
	org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:362)
	org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:332)
	com.pure.dao.hibernate.MemberHibernateDAO.getMemberList(MemberHibernateDAO.java:53)
	com.pure.domain.logic.impl.MemberFacadeImpl.getMemberList(MemberFacadeImpl.java:38)
	com.pure.web.spring.manager.member.MemberListController.memberList(MemberListController.java:66)
	com.pure.web.spring.manager.member.MemberListController.handleRequest(MemberListController.java:31)
	org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:820)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)

[/ size]

分类:Java 时间:2009-06-23 人气:511
分享到:
blog comments powered by Disqus

相关文章

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.233 (s). 12 q(s)