[ 
https://issues.apache.org/jira/browse/AXIS2-4577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Veithen resolved AXIS2-4577.
------------------------------------
    Resolution: Invalid

AFAIK, the root part of an MTOM message is never cached on disk, but always 
kept in memory (at least in recent Axiom versions). Also, closing the input 
stream would be incorrect because message parsing is deferred.

> Cached soap message cannot be deleted
> -------------------------------------
>
>                 Key: AXIS2-4577
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4577
>             Project: Axis2
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.3
>         Environment: Tomcat 5.5
>            Reporter: Michael Yang
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When caching is enabled in the axis2.xml file and MTOM is enabled, soap 
> messages that are cached are unable to be deleted after processing is 
> complete.  This can quickly consume a lot of storage as cached files will 
> keep on accumulating without being deleted.  I have traced this bug back to 
> the org.apache.axis2.builder.MIMEBuilder.processDocument(InputStream,String, 
> MessageContext) method.  When creating an OMElement for the soap message, an 
> inputstream to the cached soap message is obtained.  After the builder 
> constructs the OMElement from cached soap message the inputstream is left 
> open and the method returns.  This is the reason why the temporary cached 
> files cannot be deleted as long while the server is still running.
> The quick fix would be to just close the input stream after the OMElement is 
> created.  I have include my simple solution to the bug below:  
>  InputStream soapInput = attachments.getSOAPPartInputStream();  
>         OMElement element = builder.processDocument(soapInput,
>                                                     contentType, msgContext);
>         try{
>               soapInput.close();
>         }catch(Exception ex){
>               throw new AxisFault("Error closing inputstream to SOAP Part");
>         }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org
For additional commands, e-mail: java-dev-h...@axis.apache.org

Reply via email to