axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jira] Updated: (AXIS-1246) AttachmentsImpl.getAttachmentCount() may report 0 attachments for message that has >0 attachments
Date Wed, 03 Mar 2004 20:18:32 GMT
The following issue has been updated:

    Updater: Tom Nelson (
       Date: Wed, 3 Mar 2004 12:17 PM
             Attachment changed to axis_patch_attachmentsimpl
For a full history of the issue, see:

View the issue:

Here is an overview of the issue:
        Key: AXIS-1246
    Summary: AttachmentsImpl.getAttachmentCount() may report 0 attachments for message that
has >0 attachments
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis
             Basic Architecture
             1.2 Alpha

   Reporter: Tom Nelson

    Created: Wed, 3 Mar 2004 12:16 PM
    Updated: Wed, 3 Mar 2004 12:17 PM

When sending an org.apache.axis.Message with a javax.activation.DataHandler
attachment, the org.apache.axis.attachments.AttachmentsImpl.createAttachment()
 call is deferred until the attachments are
first serialized. The problem is that, when
org.apache.axis.Message.writeTo() is first called, it determines if attachments
exist by calling Attachments.getAttachmentCount(), and comparing to zero.
Unfortunately, at that time, the attachments have not yet been added.

I propose that the org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount() 
method be modified so that it indirectly causes the attachments to be added. The
modification would follow the example in several other AttachmentsImpl methods 
(getContentLength(), writeContentToStream(), getContentType()) where the 
multiref object is lazily created, and soapPart.getAsString() is called as an
argument to MimeUtils.createMP().

This problem shows up when using JMS transport if the log level is
set higher than debug because a debug call causes the message to be serialized 
once to a log file (thus adding the attachments) before the message is serialized
and sent to the recipient. 
In the http case, I believe that this problem is masked because of a
call to 'getContentLength()' prior to the Message.writeTo call. As noted above, the 
getContentLength() call indirectly causes the attachments to be added.

I will attach a patch file for the AttachmentsImpl class

Tom Nelson
RABA Techmologies

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

View raw message