cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: XMLStreamReader is never closed ?
Date Wed, 26 Sep 2012 16:28:12 GMT

Hmmm…  interesting.

Most likely what will need to be done is to have a StaxInEndingInterceptor that would do:

reader = msg.getContent(XMLStreamReader.class)
if (reader != null) {
    reader.close();
    msg.setContent(null, XMLStreamReader.class);
}

The StaxInInterceptor would register that if it ends up creating a XMLStreamReader.   I have
a feeling a couple other interceptors may need work as well.  The FIStaxInInterceptor likely
needs to register the same interceptor.

Hmm…


Dan


On Sep 26, 2012, at 11:36 AM, Ivan <xhhsld@gmail.com> wrote:

> I created some wrapper classes for those XMLStreamReader created in
> StaxUtils, and found that the one created with the stack below will not
> invoke the close() method, which will cause some leaking
> 
> ava.lang.Throwable
> at
> org.apache.cxf.staxutils.XXMLStreamReader.<init>(XXMLStreamReader.java:29)
> at
> org.apache.cxf.staxutils.XXMLInputFactory.createXMLStreamReader(XXMLInputFactory.java:136)
> at
> org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1280)
> at
> org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:111)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> ......
> 
> 
> java.lang.Throwable
> at
> org.apache.cxf.staxutils.XXMLStreamReader.<init>(XXMLStreamReader.java:29)
> at
> org.apache.cxf.staxutils.XXMLInputFactory.createXMLStreamReader(XXMLInputFactory.java:169)
> at
> org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1363)
> at
> org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1247)
> at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:231)
> at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:191)
> ......
> 
> Any idea for this, thanks !
> 
> -- 
> Ivan

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Mime
View raw message