axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Yang (JIRA)" <>
Subject [jira] Created: (AXIS2-4577) Cached soap message cannot be deleted
Date Mon, 07 Dec 2009 21:34:18 GMT
Cached soap message cannot be deleted

                 Key: AXIS2-4577
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.3
         Environment: Tomcat 5.5
            Reporter: Michael Yang

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);
        }catch(Exception ex){
        	throw new AxisFault("Error closing inputstream to SOAP Part");

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message