You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ji...@apache.org on 2004/03/25 21:33:58 UTC
[jira] Closed: (AXIS-1246) AttachmentsImpl.getAttachmentCount() may report 0 attachments for message that has >0 attachments
Message:
The following issue has been closed.
Resolver: Davanum Srinivas
Date: Thu, 25 Mar 2004 12:32 PM
Fixed.
thanks,
dims
---------------------------------------------------------------------
View the issue:
http://issues.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: Closed
Priority: Major
Resolution: FIXED
Project: Axis
Components:
Basic Architecture
Fix Fors:
current (nightly)
Versions:
1.2 Alpha
Assignee:
Reporter: Tom Nelson
Created: Wed, 3 Mar 2004 12:16 PM
Updated: Thu, 25 Mar 2004 12:32 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://issues.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