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 ...
随机推荐
- C#中调用PowerShell代码
在C#中调用PowerShell代码,很多时候Add是不好使的!要用AddScript!记录一下! using (Runspace runspace = RunspaceFactory.CreateR ...
- centos修改ip mac等
CentOS修改mac http://www.haowlan.com/jishuluntan/488.html CentOS 修改IP地址, DNS, 网关 http://www.21andy.com ...
- js中的url地址用function函数调用
url中输入调用函数,函数中调用ajax请求
- 实际应用中的C#加密
在系统的管理员有着实际的应用,对于一个数据库管理系统来说,数据库安全还是挺重要的,所以在存入到数据库的密码通常都是加密的.即使有着hack攻破数据库后,也不会那样的容易的盗取你的账号和密码,这样可以减 ...
- posix进程间通信
************************************************************************************************** p ...
- axis client error Bad envelope tag: definitions
http://blog.csdn.net/lifuxiangcaohui/article/details/8090503 ——————————————————————————————————————— ...
- div的定位
父DIV设置为相对定位,子DIV设置为绝对定位.<div style="height:158px; width:158px; position:relative;"> ...
- Windows消息目录
Windows消息目录1. WM_NULL=$0000:2. WM_CREATE=$0001: 应用程序创建一个窗口3. WM_DESTROY=$0002: 一个窗口被销毁4. WM_MOVE=$00 ...
- 消息中间件系列之Java API操作ActiveMQ
一.依赖 <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activem ...
- QThread 的使用方法及函数解析
近日,使用QThread,一些问题百思不得其解,看过大牛的文章,恍然大悟啊. 原文 http://hi.baidu.com/dbzhang800/item/c14c97dd15318d17e1f46f ...