首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

xfire错误:For input string: ""

2012-10-20 
xfire异常:For input string: soap包中,包含:param3 href#id0/multiRef idid0 soapenc:root0

xfire异常:For input string: ""
soap包中,包含:
<param3 href="#id0"/>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
3000
</multiRef>
java代码中,
@WebService(name = "**", targetNamespace = "***")
@SOAPBinding(use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
抛出类型转换异常:
java.lang.NumberFormatException: For input string: ""
  at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
  at java.lang.Long.parseLong(Long.java:424)
  at java.lang.Long.parseLong(Long.java:461)
  at org.codehaus.xfire.aegis.AbstractMessageReader.getValueAsLong(AbstractMessageReader.java:78)
请大侠指点!

[解决办法]
这里很明确了,就是NumberFormatException,应为你调用Long.parseLong() 时参数输入为"".

java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Long.parseLong(Long.java:424)
at java.lang.Long.parseLong(Long.java:461)
at org.codehaus.xfire.aegis.AbstractMessageReader.getValueAsLong(AbstractMessageReader.java:78)
[解决办法]
java.lang.NumberFormatException: For input string: ""
获得的是个空串

热点排行