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 ax...@ws.apache.org on 2004/09/24 22:15:31 UTC
[jira] Created: (AXIS-1573) No error message when attachment temporary file cannot be created
Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXIS-1573
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXIS-1573
Summary: No error message when attachment temporary file cannot be created
Type: Bug
Status: Unassigned
Priority: Major
Project: Axis
Versions:
current (nightly)
Assignee:
Reporter: Alex Karshakevich
Created: Fri, 24 Sep 2004 1:14 PM
Updated: Fri, 24 Sep 2004 1:14 PM
Environment: Current CVS Axis-j, Tomcat 5.0.27, Win2K, SOAP client is Axis 1.1
Description:
By default Axis saves attachments in temporary files in the default temp directory. If I forget to create this directory there will be no temp file created, and Axis will quietly lose the contents of the attachment.
If I create the temp directory everything works well.
The problematic method appears to be org.apache.axis.attachments.ManagedMemoryDataSource.flushToDisk() which only catches SecurityException.
After failing to create the temp file the attachment behaves incorrectly when I try to read from the DataHandler's input stream. In the call to ManagedMemoryDataSource.Instream.read(), memorybuflist is null (since content should be on disk), and diskCacheFile is null (since the file has not been created), it returns 0 as the number of bytes read instead of -1 or some exception.
In my particular case the attachment is a zipped file, and trying to call getNextEntry() causes an infinite loop as it tries to read the stream.
---------------------------------------------------------------------
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
[jira] Commented: (AXIS-1573) No error message when attachment temporary file cannot be created
Posted by ax...@ws.apache.org.
The following comment has been added to this issue:
Author: Davanum Srinivas
Created: Thu, 14 Oct 2004 1:56 PM
Body:
Any suggestions on how to fix this?
---------------------------------------------------------------------
View this comment:
http://issues.apache.org/jira/browse/AXIS-1573?page=comments#action_54104
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXIS-1573
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXIS-1573
Summary: No error message when attachment temporary file cannot be created
Type: Bug
Status: Unassigned
Priority: Major
Project: Axis
Versions:
current (nightly)
Assignee:
Reporter: Alex Karshakevich
Created: Fri, 24 Sep 2004 1:14 PM
Updated: Thu, 14 Oct 2004 1:56 PM
Environment: Current CVS Axis-j, Tomcat 5.0.27, Win2K, SOAP client is Axis 1.1
Description:
By default Axis saves attachments in temporary files in the default temp directory. If I forget to create this directory there will be no temp file created, and Axis will quietly lose the contents of the attachment.
If I create the temp directory everything works well.
The problematic method appears to be org.apache.axis.attachments.ManagedMemoryDataSource.flushToDisk() which only catches SecurityException.
After failing to create the temp file the attachment behaves incorrectly when I try to read from the DataHandler's input stream. In the call to ManagedMemoryDataSource.Instream.read(), memorybuflist is null (since content should be on disk), and diskCacheFile is null (since the file has not been created), it returns 0 as the number of bytes read instead of -1 or some exception.
In my particular case the attachment is a zipped file, and trying to call getNextEntry() causes an infinite loop as it tries to read the stream.
---------------------------------------------------------------------
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
[jira] Commented: (AXIS-1573) No error message when attachment temporary file cannot be created
Posted by "Alex Karshakevich (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXIS-1573?page=comments#action_54745 ]
Alex Karshakevich commented on AXIS-1573:
-----------------------------------------
I think the problem is that org.apache.axis.attachments.ManagedMemoryDataSource.flushToDisk() clears the memory buffer before it even starts to open the disk file.
Just check:
protected void flushToDisk()
throws java.io.IOException, java.io.FileNotFoundException {
java.util.LinkedList ml = memorybuflist;
----> memorybuflist = null;
log.debug(Messages.getMessage("maxCached", "" + maxCached,
"" + totalsz));
if (ml != null) {
....go on to attempt to write to file
Thus memorybuflist is gone whether or not writing was successful.
I think the intent of the catch block for SecurityException was to keep the atachment in memory, but it will be gone. I would remove that line s.t. memory is cleared only after a successful write.
It's probably a good idea to put a log in org.apache.axis.attachments.ManagedMemoryDataSource.getName() when flushToDisk() throws the IOException. This will at least alert that the file got lost.
> No error message when attachment temporary file cannot be created
> -----------------------------------------------------------------
>
> Key: AXIS-1573
> URL: http://issues.apache.org/jira/browse/AXIS-1573
> Project: Axis
> Type: Bug
> Versions: current (nightly)
> Environment: Current CVS Axis-j, Tomcat 5.0.27, Win2K, SOAP client is Axis 1.1
> Reporter: Alex Karshakevich
>
> By default Axis saves attachments in temporary files in the default temp directory. If I forget to create this directory there will be no temp file created, and Axis will quietly lose the contents of the attachment.
> If I create the temp directory everything works well.
> The problematic method appears to be org.apache.axis.attachments.ManagedMemoryDataSource.flushToDisk() which only catches SecurityException.
> After failing to create the temp file the attachment behaves incorrectly when I try to read from the DataHandler's input stream. In the call to ManagedMemoryDataSource.Instream.read(), memorybuflist is null (since content should be on disk), and diskCacheFile is null (since the file has not been created), it returns 0 as the number of bytes read instead of -1 or some exception.
> In my particular case the attachment is a zipped file, and trying to call getNextEntry() causes an infinite loop as it tries to read the stream.
--
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
[jira] Resolved: (AXIS-1573) No error message when attachment temporary file cannot be created
Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
[ http://nagoya.apache.org/jira/browse/AXIS-1573?page=history ]
Davanum Srinivas resolved AXIS-1573:
------------------------------------
Resolution: Fixed
Fixed. removed the extra "memorybuflist = null;"
thanks,
dims
> No error message when attachment temporary file cannot be created
> -----------------------------------------------------------------
>
> Key: AXIS-1573
> URL: http://nagoya.apache.org/jira/browse/AXIS-1573
> Project: Axis
> Type: Bug
> Versions: current (nightly)
> Environment: Current CVS Axis-j, Tomcat 5.0.27, Win2K, SOAP client is Axis 1.1
> Reporter: Alex Karshakevich
>
> By default Axis saves attachments in temporary files in the default temp directory. If I forget to create this directory there will be no temp file created, and Axis will quietly lose the contents of the attachment.
> If I create the temp directory everything works well.
> The problematic method appears to be org.apache.axis.attachments.ManagedMemoryDataSource.flushToDisk() which only catches SecurityException.
> After failing to create the temp file the attachment behaves incorrectly when I try to read from the DataHandler's input stream. In the call to ManagedMemoryDataSource.Instream.read(), memorybuflist is null (since content should be on disk), and diskCacheFile is null (since the file has not been created), it returns 0 as the number of bytes read instead of -1 or some exception.
> In my particular case the attachment is a zipped file, and trying to call getNextEntry() causes an infinite loop as it tries to read the stream.
--
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
[jira] Commented: (AXIS-1573) No error message when attachment temporary file cannot be created
Posted by ax...@ws.apache.org.
The following comment has been added to this issue:
Author: Davanum Srinivas
Created: Thu, 14 Oct 2004 1:56 PM
Body:
Any suggestions on how to fix this?
---------------------------------------------------------------------
View this comment:
http://issues.apache.org/jira/browse/AXIS-1573?page=comments#action_54103
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXIS-1573
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXIS-1573
Summary: No error message when attachment temporary file cannot be created
Type: Bug
Status: Unassigned
Priority: Major
Project: Axis
Versions:
current (nightly)
Assignee:
Reporter: Alex Karshakevich
Created: Fri, 24 Sep 2004 1:14 PM
Updated: Thu, 14 Oct 2004 1:56 PM
Environment: Current CVS Axis-j, Tomcat 5.0.27, Win2K, SOAP client is Axis 1.1
Description:
By default Axis saves attachments in temporary files in the default temp directory. If I forget to create this directory there will be no temp file created, and Axis will quietly lose the contents of the attachment.
If I create the temp directory everything works well.
The problematic method appears to be org.apache.axis.attachments.ManagedMemoryDataSource.flushToDisk() which only catches SecurityException.
After failing to create the temp file the attachment behaves incorrectly when I try to read from the DataHandler's input stream. In the call to ManagedMemoryDataSource.Instream.read(), memorybuflist is null (since content should be on disk), and diskCacheFile is null (since the file has not been created), it returns 0 as the number of bytes read instead of -1 or some exception.
In my particular case the attachment is a zipped file, and trying to call getNextEntry() causes an infinite loop as it tries to read the stream.
---------------------------------------------------------------------
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