使用webService调用接口,返回的是xml格式,运用xstream解析的时候,出现了如下的错误:

 Exception in thread "Timer-1" com.thoughtworks.xstream.converters.ConversionException: For input string: "VS" : For input string: "VS"
---- Debugging information ----
message : For input string: "VS"
cause-exception : java.lang.NumberFormatException
cause-message : For input string: "VS"
class : java.lang.Integer
required-type : java.lang.Integer
converter-type : com.thoughtworks.xstream.converters.SingleValueConverterWrapper
wrapped-converter : com.thoughtworks.xstream.converters.basic.IntConverter
path : /interface/items/roomstate
class[1] : catic.hotel.server.webservice.Items
converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
class[2] : catic.hotel.server.webservice.Interface
version : null
-------------------------------
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:355)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:306)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:234)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:322)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:234)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1058)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1042)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:913)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:904)
at catic.library.util.XmlBeanConvertUtil.xml2Bean(XmlBeanConvertUtil.java:27)
at catic.library.util.XMLUtil.roomStatusXmlToList2(XMLUtil.java:86)
at catic.hotel.server.server.ReadDataByPMSOurDB$ReadPMSUptOurDB.run(ReadDataByPMSOurDB.java:104)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
Caused by: java.lang.NumberFormatException: For input string: "VS"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at java.lang.Long.valueOf(Unknown Source)
at java.lang.Long.decode(Unknown Source)
at com.thoughtworks.xstream.converters.basic.IntConverter.fromString(IntConverter.java:27)
at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.fromString(SingleValueConverterWrapper.java:41)
at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.unmarshal(SingleValueConverterWrapper.java:49)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
... 26 more

由43行可以看出,是类型转换异常,因为返回的类型既有String,又有Integer,而我只用了Integer,忽略了String,所以报错。

刚开始还以为是使用xstream报的错,由于是第一次使用这个东东……不过,xstream这个东东真的很好用。

com.thoughtworks.xstream.converters.ConversionException的更多相关文章

  1. JMeter导入jmx运行脚本时出现这样的错误jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException:

    2016/12/20 13:51:55 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.conve ...

  2. jmeter—打开jmx报com.thoughtworks.xstream.converters.ConversionException

    打开出错的jmx文件,查看出错行 由于缺少PerfMon Metrics Collector插件,所以报这个错误 下载地址(https://jmeter-plugins.org/downloads/a ...

  3. jmeter导入jmx文件报错:missing class com.thoughtworks.xstream.converters.ConversionException

    有的时候我们会参考别人的jmx文件,但是在导入的时候会报错如下图: 实际上是告诉我们缺少jar包所引起的,下载对应jar包放到jmeter安装目录对应的lib/ext下就可以了,如下图: jmeter ...

  4. 建立Maven工程时出错,Failure to transfer com.thoughtworks.xstream:xstream:jar:1.3.1

    Failure to transfer com.thoughtworks.xstream:xstream:jar: from http://repo1.maven.org/maven2 was cac ...

  5. maven的pom 提示错误 Failure to transfer com.thoughtworks.xstream:xstream:jar:

    pom文件提示错误,信息如下 Description    Resource    Path    Location    TypeFailure to transfer com.thoughtwor ...

  6. eclipse中Maven项目pom.xml报错:com.thoughtworks.xstream.io.HierarchicalStreamDriver

    eclipse中创建Maven项目时 pom.xml报错:com.thoughtworks.xstream.io.HierarchicalStreamDriver 解决方案1.在pom文件中加入mav ...

  7. 使用ssm整合是创建Maven项目报错Failure to transfer com.thoughtworks.xstream:xstream:pom:1.3.1

    Description Resource Path Location TypeFailure to transfer com.thoughtworks.xstream:xstream:pom:1.3. ...

  8. RCE via XStream object deserialization && SECURITY-247 / CVE-2016-0792 XML reconstruction Object Code Inject

    catalogue . Java xStream . DynamicProxyConverter . java.beans.EventHandler . RCE via XStream object ...

  9. 【XML】xStream浅录

    XStream可以用来转换对象-XML,或者XML-对象. 官网地址:http://x-stream.github.io 小案例: 实体类 FileVo.java package cn.pinnsvi ...

随机推荐

  1. linux环境变量设置 以及 source命令 Linux 之 /etc/profile、~/.bash_profile 等几个文件的执行过程 Linux 设置环境变量

    定制环境变量  环境变量是和Shell紧密相关的,用户登录系统后就启动了一个Shell.对于Linux来说一般是bash,但也可以重新设定或切换到其它的Shell.环境变量文件:/etc/profil ...

  2. #include<algorithm>里的函数

    #include<algorithm>里的函数   #include<algorithm>     非修改性序列操作(12个)   循环 对序列中的每个元素执行某操作 for_ ...

  3. Activiti工作流学习要点

    1. 1个插件 在Eclipse中安装Activiti插件,让你可以在Eclipse中绘制Activiti工作流图 2. 1个引擎 ProcessEngine对象,Activiti工作流引擎.这是Ac ...

  4. 【Unity笔记】角色的移动方法

    方法一:改变物体的transform public class ExampleClass : MonoBehaviour { ; // 跟随摄像机的移动要写在LateUpdate中 void Late ...

  5. Linux 网络子系统之NAPI书签

    只是一个书签 http://blog.csdn.net/ustc_dylan/article/details/6116334

  6. java父子进程通信

    1.利用进程的管道通信传输流 2.子进程没有控制台,正常测试的时候也是没办法看到子进程的输出的,需要传到主线程 3.测试主进程传参给子进程再传回来 4.父进程启动子进程只要执行runtime.exec ...

  7. 浅谈Log4j和Log4j2的区别

    相信很多程序猿朋友对log4j都很熟悉,log4j可以说是陪伴了绝大多数的朋友开启的编程.我不知道log4j之前是用什么,至少在我的生涯中,是log4j带我开启的日志时代. log4j是Apache的 ...

  8. 腾讯云 Linux 挂载数据盘

            查看已挂载的硬盘   1) 运行fdisk -l命令查看硬盘信息.   硬盘从未进行初始化时,需要先创建文件系统,       硬盘格式化   运行mkfs.ext4 device_n ...

  9. 标题添加菜单HeaderContextMenu

    <!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>Co ...

  10. Jquery easyui tree 一些常见操作

    Tree: easyui tree的异步加载实现很简单,easyui的中文API文档中有实例(http://api.btboys.com/easyui/)——创建异步树形菜单,就是在tree node ...