“ IOException:奇怪的I / O流”;在CXF服务客户端中 [英] "IOException: Strange I/O stream" in CXF service client

查看:75
本文介绍了“ IOException:奇怪的I / O流”;在CXF服务客户端中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们看到CXF中出现间歇性错误。响应相当大(数百KB),已启用MTOM,并为CXF请求/响应日志记录拦截器启用DEBUG可解决此问题,类似于此帖子上放入cxf-logging>此帖子(尚未解决)。我们的项目正在使用CXF版本2.2.9。

We are seeing an intermittent error in CXF. The response is fairly large (several hundred KB), MTOM is enabled, and enabling DEBUG for the CXF request/response logging interceptors fixes the issue, similarly to this post (which is unresolved). Our project is leveraging CXF version 2.2.9.

javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: [was class java.io.IOException] Strange I/O stream, returned 0 bytes on read 
                at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)
                at com.sun.proxy.$Proxy751.browseFiles(Unknown Source)
…
                at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: [was class java.io.IOException] Strange I/O stream, returned 0 bytes on read
                at com.ctc.wstx.util.ExceptionUtil.throwRuntimeException(ExceptionUtil.java:18)
                at com.ctc.wstx.sr.StreamScanner.throwLazyError(StreamScanner.java:731)
                at com.ctc.wstx.sr.BasicStreamReader.safeFinishToken(BasicStreamReader.java:3657)
                at com.ctc.wstx.sr.BasicStreamReader.getTextCharacters(BasicStreamReader.java:830)
                at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleCharacters(StAXStreamConnector.java:323)
…
                at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
                ... 51 more
Caused by: java.io.IOException: Strange I/O stream, returned 0 bytes on read
                at com.ctc.wstx.io.BaseReader.reportStrangeStream(BaseReader.java:148)
                at com.ctc.wstx.io.UTF8Reader.loadMore(UTF8Reader.java:373)
…

最初,我认为这是由响应数据中的错误/无效字符(编码?)引起的;但是,现在看起来更像是网络问题。奇怪的是,该服务已经运行了很长时间(多年),直到出现此问题。

I initially thought this was caused by a bad/invalid character (encoding?) in the response data; however, it is now looking more like a network issue. It is very odd, the service has been operating for a long time (years) without issue prior to running into this problem.

为什么会出现此错误?是否可以在不启用调试日志记录的情况下解决此问题?

Why does this error occur? Is there a way to resolve this without enabling debug logging?

推荐答案

就像升级到CXF的较新版本一样,可以解决此问题。 CXF哑剧流中存在一些错误。特别是,它看起来非常类似于:

Likely an upgrade to a newer version of CXF may fix this. There were some bugs in the CXF mime streams. In particular, this looks very similar to:

https://issues.apache.org/jira/browse/CXF-3068

这篇关于“ IOException:奇怪的I / O流”;在CXF服务客户端中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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