【发布时间】:2013-10-07 15:55:17
【问题描述】:
我的问题类似于: JAX-WS SoapHandler with large messages: OutOfMemoryError 和 JAXWS Soap Handler Large MTOM Attachments
我正在使用 tomcat,即 Metro-Runtime-Configuration,当 我想在我的 HandlerChain 中添加一个标头时,它给了我一个 OutOfMemory 异常。
public boolean handleMessage(SOAPMessageContext smc) {
if (Boolean.TRUE.equals(smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY))) {
SOAPMessage sm = smc.getMessage(); // <- OutOfMemory
...
在第一个链接中,Ahmed 写道 I was able to write code that handles the raw data stream in 3 out of the 4 cases. Fortunately the three cases included the two we were mostly interested in: to/from the server.,但他没有为此提供代码 sn-p。
我尝试过的事情:
OutOfMemory 出现在我无法覆盖的 JDK7 AbstractMessageImpl#readAsSOAPMessage 中。是否可以使用自定义引导程序覆盖该类?以及如何做到这一点?我能够“覆盖”Integer-class,但 AbstractMessageImpl 没有被占用。
将运行时更改为 Apache CXF 不适用于我生成的 JAX-WS RI 客户端 (Cannot create a secure XMLInputFactory)
还有其他使用其他提供程序/运行时的可能性吗?如果没有,我该如何覆盖JDK7的AbstractMessageImpl#readAsSOAPMessage?
或者:是否可以配置 MTOM 和处理程序链的顺序? MTOM 的消息不应该引发 OutOfMemory,对吗?
在此先感谢你的克拉皮
【问题讨论】:
标签: tomcat soap jax-ws out-of-memory mtom