Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 88993 invoked from network); 3 Mar 2004 20:18:14 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 3 Mar 2004 20:18:14 -0000 Received: (qmail 89171 invoked by uid 500); 3 Mar 2004 20:18:00 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 89148 invoked by uid 500); 3 Mar 2004 20:17:59 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 89137 invoked from network); 3 Mar 2004 20:17:59 -0000 Received: from unknown (HELO exchange.sun.com) (192.18.33.10) by daedalus.apache.org with SMTP; 3 Mar 2004 20:17:59 -0000 Received: (qmail 11498 invoked from network); 3 Mar 2004 20:18:32 -0000 Received: from localhost (HELO nagoya) (127.0.0.1) by nagoya.betaversion.org with SMTP; 3 Mar 2004 20:18:32 -0000 Message-ID: <771954543.1078345112003.JavaMail.apache@nagoya> Date: Wed, 3 Mar 2004 12:18:32 -0800 (PST) From: jira@apache.org To: axis-dev@ws.apache.org Subject: [jira] Updated: (AXIS-1246) AttachmentsImpl.getAttachmentCount() may report 0 attachments for message that has >0 attachments Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N The following issue has been updated: Updater: Tom Nelson (mailto:tom.nelson@raba.com) Date: Wed, 3 Mar 2004 12:17 PM Changes: Attachment changed to axis_patch_attachmentsimpl --------------------------------------------------------------------- For a full history of the issue, see: http://nagoya.apache.org/jira/secure/ViewIssue.jspa?key=AXIS-1246&page=history --------------------------------------------------------------------- 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:17 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