com.thoughtworks.xstream.converters.ConversionException
使用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的更多相关文章
- 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 ...
- jmeter—打开jmx报com.thoughtworks.xstream.converters.ConversionException
打开出错的jmx文件,查看出错行 由于缺少PerfMon Metrics Collector插件,所以报这个错误 下载地址(https://jmeter-plugins.org/downloads/a ...
- jmeter导入jmx文件报错:missing class com.thoughtworks.xstream.converters.ConversionException
有的时候我们会参考别人的jmx文件,但是在导入的时候会报错如下图: 实际上是告诉我们缺少jar包所引起的,下载对应jar包放到jmeter安装目录对应的lib/ext下就可以了,如下图: jmeter ...
- 建立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 ...
- maven的pom 提示错误 Failure to transfer com.thoughtworks.xstream:xstream:jar:
pom文件提示错误,信息如下 Description Resource Path Location TypeFailure to transfer com.thoughtwor ...
- eclipse中Maven项目pom.xml报错:com.thoughtworks.xstream.io.HierarchicalStreamDriver
eclipse中创建Maven项目时 pom.xml报错:com.thoughtworks.xstream.io.HierarchicalStreamDriver 解决方案1.在pom文件中加入mav ...
- 使用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. ...
- 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 ...
- 【XML】xStream浅录
XStream可以用来转换对象-XML,或者XML-对象. 官网地址:http://x-stream.github.io 小案例: 实体类 FileVo.java package cn.pinnsvi ...
随机推荐
- LeetCode: Maximal Rectangle 解题报告
Maximal RectangleGiven a 2D binary matrix filled with 0's and 1's, find the largest rectangle contai ...
- 【Java】ParseInt方法
parseInt()方法首先查看位置0处的 字符,判断它是否是个有效数字:如果不是,该方法将返回NaN,不再继续执行其他操作.但如果该字符是有效数字,该方法将查看位置1处的字符,进行同样的 测试.这一 ...
- pyQt绘图
def paintEvent(self, e): qp = QtGui.QPainter() qp.begin(self) self.DrawChessBoard(qp) self.Draw_Ches ...
- Jar/War/Ear等包的作用与区别详解
以客户角度来看,jar文件就是一种封装格式,用户不需要知道jar包中有多少个.class格式的文件及每个文件中的功能与作用,也可以得到相应的访问的结果.java中除了jar格式还有war和ear等包文 ...
- 基于jQuery左右滑动切换图片代码
分享一款基于jQuery左右滑动切换图片代码.这是一款基于jQuery实现的左右滑动切换焦点图代码.效果图如下: 在线预览 源码下载 实现的代码: <div class="v_ou ...
- python idea 利用树莓派做家庭报警系统
1 利用树莓派做家庭报警系统idea 功能如下: 1.程序家侧人不在家(7:00-6:00) 2.树莓派搭配摄像头,对这门进行图像识别,如果变化,门开了,就报警: 3.报警的方式是给我发短信,采信,或 ...
- 【C#/WPF】图像变换的Undo撤销——用Stack命令栈
需求: 图层中有一张图片,可以对该图层进行平移.缩放.旋转操作,现在要求做Undo撤销功能,使得图层回复上一步操作时的状态. 关于图像的平移.缩放.旋转,可以参考在下的另一篇博客的整理: http:/ ...
- Eclipse 中 Debug 模式跳转到 exitCurrentThread 的问题解决
问题描述: Debug 模式启动项目,断点跳转到exitCurrentThread 解决方法: 修改Eclipse 配置 [window]->[Preferences]->[Java]-& ...
- EasyUi---searchbox 条件查询
前台UI参考代码: <script type="text/javascript" charset="utf-8"> $(function(){ /* ...
- 用CSS创建打印页面
用CSS创建打印页面,不必为打印而专门建立一个HTML文件,可以节省一些体力,其前提是按“WEB标准”用CSS+DIV布局HTML页面. 第一.在HTML页面加入为打印机设置的CSS文件 <li ...