Xstream无参数构造函数错误 [英] Xstream no-args constructor error

查看:126
本文介绍了Xstream无参数构造函数错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试创建Transacao的实例时,我收到以下错误

I'm getting the following error when it tries to create an instance of 'Transacao'

`Error: Cannot construct br.com.cbmp.ecommerce.resposta.Transacao as it does not have a no-args constructor : Cannot construct br.com.cbmp.ecommerce.resposta.Transacao as it does not have a no-args constructor `

---- Debugging information ----

message : Cannot construct br.com.cbmp.ecommerce.resposta.Transacao as it does not have a no-args constructor 

cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException 

cause-message : Cannot construct br.com.cbmp.ecommerce.resposta.Transacao as it does not have a no-args constructor `

class : br.com.cbmp.ecommerce.resposta.Transacao 

required-type : br.com.cbmp.ecommerce.resposta.Transacao 

path : /transacao

我知道XStream有一个错误1.3.1和JDK7,但我目前使用XStream 1.3.1和 JDK6

I am aware that there's a bug with XStream 1.3.1 and JDK7, but I'm currently using XStream 1.3.1 and JDK6. Any ideas why this error is still happening?

感谢

推荐答案

3解决方案:


  1. 提供无参数的构造函数


  2. 升级到xstream 1.4.4 *

我始终使用解决方案#2 。

I use solution #2 all the time.

*我验证1.2.2不工作,1.4.4工作,没有尝试任何版本之间

*I verified 1.2.2 doesn't work and 1.4.4 does work, haven't tried any versions in-between

这篇关于Xstream无参数构造函数错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆