axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [jira] Commented: (AXIS-1246) AttachmentsImpl.getAttachmentCount() may report 0 attachments for message that has >0 attachments
Date Wed, 03 Mar 2004 20:26:32 GMT
The following comment has been added to this issue:

     Author: Davanum Srinivas
    Created: Wed, 3 Mar 2004 12:25 PM
       Body:
Tom,

The patch seems to be specific to MIME. what happens for DIME?

-- dims
---------------------------------------------------------------------
View this comment:
  http://nagoya.apache.org/jira/secure/ViewIssue.jspa?key=AXIS-1246&page=comments#action_20954

---------------------------------------------------------------------
View the issue:
  http://nagoya.apache.org/jira/secure/ViewIssue.jspa?key=AXIS-1246

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
 Components: 
             Basic Architecture
   Versions:
             1.2 Alpha

   Assignee: 
   Reporter: Tom Nelson

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

Description:
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


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message