select new com.clsss 报 could not instantiate class from tuple
来源:互联网 发布:php 考试开源系统源码 编辑:程序博客网 时间:2024/06/06 02:35
今天原来跑的好好的代码,在sqlserver的数据库中发现有错误 :
org.springframework.orm.hibernate3.HibernateQueryException: could not instantiate class [xxx] from tuple; nested exception is org.hibernate.QueryException: could not instantiate class [xxx] from tuple at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:656) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411) at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) at org.springframework.orm.hibernate3.CTPHibernateTemplate.findBy(CTPHibernateTemplate.java:146) at org.springframework.orm.hibernate3.CTPHibernateTemplate.findByNamedParam(CTPHibernateTemplate.java:134)
...
Caused by: java.lang.IllegalArgumentExceptionat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)at java.lang.reflect.Constructor.newInstance(Constructor.java:513)at org.hibernate.transform.AliasToBeanConstructorResultTransformer.transformTuple(AliasToBeanConstructorResultTransformer.java:55)... 106 more
但是在postgre跑得好好的
于是进代码跟踪,最终发现是在构造一个vo的时候select new com.xxxvo(doc.id as id,doc.parentFrId as pid,doc.commentEnabled as commentEnabled),入参有一个值是null,但vo中定义的是boolean.把这个入参转化成布尔值后,错误消除。
究其原因是在sqlserver下修改过原表中字段的默认值,但是只对新数据有效,原来的数据不能修改为新默认值,还保持了原来的null,再次对其应用update后才修改了。
- select new com.clsss 报 could not instantiate class from tuple
- could not instantiate class [xxx] from tuple
- 关于报错 'Could not instantiate class named NSLayoutConstraint
- Xcode报错:Could not instantiate class named NSLayoutConstraint解决办法
- mybatis报错:Could not instantiate bean class [Dao.stuDao]: Specified class is an interface
- Could not instantiate class named NSLayoutConstraint
- 解决Could not instantiate class named NSLayoutConstraint
- ibatis:JavaBeansDataExchange could not instantiate result class
- reason: ‘Could not instantiate class named NSLayoutConstraint’
- Could not instantiate class named NSLayoutConstraint
- Could not instantiate class named NSLayoutConstraint
- 'NSInvalidUnarchiveOperationException' 'Could not instantiate class named 'NSLayoutConstraint'
- Could not instantiate class named NSLayoutConstraint
- Could not instantiate class named NSLayoutConstraint
- NSInvalidUnarchiveOperationException: Could not instantiate class named NSLayoutConstraint
- Could not instantiate class named NSLayoutConstraint
- Could not instantiate class named NSLayoutConstraint
- Could not instantiate class named MKMapView
- myeclipse 8.5最新注册码
- HDU 2412 Party at Hali-Bula
- 网站优化一:apache开启gzip压缩配置详解
- 用iptables抗cc的方法
- timestamp
- select new com.clsss 报 could not instantiate class from tuple
- 基于Andoird 4.2.2的同步框架源代码学习——同步发起端
- table 边框问题
- [linux]linux内核编译过程的最终总结版
- Linux2.6 内核的 Initrd 机制解析
- int,int32_t,int64_t
- httpClient下载图片
- 存储过程实现登录验证
- jsp下显示中文文件名的图片解决办法