You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "R.O. (JIRA)" <ji...@apache.org> on 2008/08/11 17:19:44 UTC

[jira] Created: (CXF-1743) Temporary files are not deleted

Temporary files are not deleted
-------------------------------

                 Key: CXF-1743
                 URL: https://issues.apache.org/jira/browse/CXF-1743
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.1.1
         Environment: Linux, FreeBSD
            Reporter: R.O.


I have endpoint declared in Spring as follows:
---
	<jaxws:endpoint id="importService"
		implementor="my.ImportServiceImpl"
		address="/importService">
		<jaxws:properties>
			<entry key="mtom-enabled" value="true" />
		</jaxws:properties>
	</jaxws:endpoint>

---

During tests I discovered, that large attachments (>64k), which are saved in temporary files, are not removed after processing SOAP message.







-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CXF-1743) Temporary files are not deleted

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp reassigned CXF-1743:
--------------------------------

    Assignee: Daniel Kulp

> Temporary files are not deleted
> -------------------------------
>
>                 Key: CXF-1743
>                 URL: https://issues.apache.org/jira/browse/CXF-1743
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.1, 2.1.2
>         Environment: Linux, FreeBSD
>            Reporter: R.O.
>            Assignee: Daniel Kulp
>
> I have endpoint declared in Spring as follows:
> ---
> 	<jaxws:endpoint id="importService"
> 		implementor="my.ImportServiceImpl"
> 		address="/importService">
> 		<jaxws:properties>
> 			<entry key="mtom-enabled" value="true" />
> 		</jaxws:properties>
> 	</jaxws:endpoint>
> ---
> During tests I discovered, that large attachments (>64k), which are saved in temporary files, are not removed after processing SOAP message.
> I've analysed sources of org.apache.cxf.attachment.AttachmentDataSource and org.apache.cxf.io.CachedOutputStream and discovered that AttachmentDataSource does not allow to close cache. 
> The only solution is to add close() method to AttachmentDataSource and close cache manually.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-1743) Temporary files are not deleted

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-1743.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.9
                   2.1.2

> Temporary files are not deleted
> -------------------------------
>
>                 Key: CXF-1743
>                 URL: https://issues.apache.org/jira/browse/CXF-1743
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.1, 2.1.2
>         Environment: Linux, FreeBSD
>            Reporter: R.O.
>            Assignee: Daniel Kulp
>             Fix For: 2.1.2, 2.0.9
>
>
> I have endpoint declared in Spring as follows:
> ---
> 	<jaxws:endpoint id="importService"
> 		implementor="my.ImportServiceImpl"
> 		address="/importService">
> 		<jaxws:properties>
> 			<entry key="mtom-enabled" value="true" />
> 		</jaxws:properties>
> 	</jaxws:endpoint>
> ---
> During tests I discovered, that large attachments (>64k), which are saved in temporary files, are not removed after processing SOAP message.
> I've analysed sources of org.apache.cxf.attachment.AttachmentDataSource and org.apache.cxf.io.CachedOutputStream and discovered that AttachmentDataSource does not allow to close cache. 
> The only solution is to add close() method to AttachmentDataSource and close cache manually.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-1743) Temporary files are not deleted

Posted by "R.O. (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

R.O. updated CXF-1743:
----------------------

          Component/s: Core
          Description: 
I have endpoint declared in Spring as follows:
---
	<jaxws:endpoint id="importService"
		implementor="my.ImportServiceImpl"
		address="/importService">
		<jaxws:properties>
			<entry key="mtom-enabled" value="true" />
		</jaxws:properties>
	</jaxws:endpoint>

---

I've analysed sources of org.apache.cxf.attachment.AttachmentDataSource and org.apache.cxf.io.CachedOutputStream and discovered that AttachmentDataSource does not allow to close cache. 
The only solution is to add closeCache() method to AttachmentDataSource and close cache manually.
During tests I discovered, that large attachments (>64k), which are saved in temporary files, are not removed after processing SOAP message.







  was:
I have endpoint declared in Spring as follows:
---
	<jaxws:endpoint id="importService"
		implementor="my.ImportServiceImpl"
		address="/importService">
		<jaxws:properties>
			<entry key="mtom-enabled" value="true" />
		</jaxws:properties>
	</jaxws:endpoint>

---

During tests I discovered, that large attachments (>64k), which are saved in temporary files, are not removed after processing SOAP message.







    Affects Version/s: 2.1.2

> Temporary files are not deleted
> -------------------------------
>
>                 Key: CXF-1743
>                 URL: https://issues.apache.org/jira/browse/CXF-1743
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.1, 2.1.2
>         Environment: Linux, FreeBSD
>            Reporter: R.O.
>
> I have endpoint declared in Spring as follows:
> ---
> 	<jaxws:endpoint id="importService"
> 		implementor="my.ImportServiceImpl"
> 		address="/importService">
> 		<jaxws:properties>
> 			<entry key="mtom-enabled" value="true" />
> 		</jaxws:properties>
> 	</jaxws:endpoint>
> ---
> I've analysed sources of org.apache.cxf.attachment.AttachmentDataSource and org.apache.cxf.io.CachedOutputStream and discovered that AttachmentDataSource does not allow to close cache. 
> The only solution is to add closeCache() method to AttachmentDataSource and close cache manually.
> During tests I discovered, that large attachments (>64k), which are saved in temporary files, are not removed after processing SOAP message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1743) Temporary files are not deleted

Posted by "Matt Todd (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644269#action_12644269 ] 

Matt Todd commented on CXF-1743:
--------------------------------

I've just tested this in the 2.1.3 version under linux (opensuse 11) and it doesn't generate files anymore.  Under Windows server 2008 its still leaves the files lying around.  Both use the latest java 6 release.  Have you tested it under windows at any time?

> Temporary files are not deleted
> -------------------------------
>
>                 Key: CXF-1743
>                 URL: https://issues.apache.org/jira/browse/CXF-1743
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.1, 2.1.2
>         Environment: Linux, FreeBSD
>            Reporter: R.O.
>            Assignee: Daniel Kulp
>             Fix For: 2.1.2, 2.0.9
>
>
> I have endpoint declared in Spring as follows:
> ---
> 	<jaxws:endpoint id="importService"
> 		implementor="my.ImportServiceImpl"
> 		address="/importService">
> 		<jaxws:properties>
> 			<entry key="mtom-enabled" value="true" />
> 		</jaxws:properties>
> 	</jaxws:endpoint>
> ---
> During tests I discovered, that large attachments (>64k), which are saved in temporary files, are not removed after processing SOAP message.
> I've analysed sources of org.apache.cxf.attachment.AttachmentDataSource and org.apache.cxf.io.CachedOutputStream and discovered that AttachmentDataSource does not allow to close cache. 
> The only solution is to add close() method to AttachmentDataSource and close cache manually.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-1743) Temporary files are not deleted

Posted by "R.O. (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

R.O. updated CXF-1743:
----------------------

    Description: 
I have endpoint declared in Spring as follows:
---
	<jaxws:endpoint id="importService"
		implementor="my.ImportServiceImpl"
		address="/importService">
		<jaxws:properties>
			<entry key="mtom-enabled" value="true" />
		</jaxws:properties>
	</jaxws:endpoint>

---

During tests I discovered, that large attachments (>64k), which are saved in temporary files, are not removed after processing SOAP message.

I've analysed sources of org.apache.cxf.attachment.AttachmentDataSource and org.apache.cxf.io.CachedOutputStream and discovered that AttachmentDataSource does not allow to close cache. 
The only solution is to add close() method to AttachmentDataSource and close cache manually.








  was:
I have endpoint declared in Spring as follows:
---
	<jaxws:endpoint id="importService"
		implementor="my.ImportServiceImpl"
		address="/importService">
		<jaxws:properties>
			<entry key="mtom-enabled" value="true" />
		</jaxws:properties>
	</jaxws:endpoint>

---

I've analysed sources of org.apache.cxf.attachment.AttachmentDataSource and org.apache.cxf.io.CachedOutputStream and discovered that AttachmentDataSource does not allow to close cache. 
The only solution is to add closeCache() method to AttachmentDataSource and close cache manually.
During tests I discovered, that large attachments (>64k), which are saved in temporary files, are not removed after processing SOAP message.








My solution (hack) of this bug:

1. add close() method to AttachmentDataSource:
    /**
     * The only way to clean temporary files.
     * 
     * @throws IOException if closing cache threw an exception.  
     */
    public void close() throws IOException {
        cache.close();
    }

2. manually close LazyDataSource objects used to access uploaded attachments using such helper method:

	public static void closeDatasource(DataSource ds) {
		if(ds != null && ds instanceof LazyDataSource) {
			if(((LazyDataSource) ds).getDataSource() instanceof AttachmentDataSource) {
				AttachmentDataSource attDS = (AttachmentDataSource) ((LazyDataSource) ds).getDataSource();
				try {
					attDS.close();
				} catch (IOException e) {
					// logger.error(e.getMessage(), e);
				}
			}
		}
		
	}

This fixes this bug in 2.1.1 and probably in 2.1.2-SNAPSHOT.


> Temporary files are not deleted
> -------------------------------
>
>                 Key: CXF-1743
>                 URL: https://issues.apache.org/jira/browse/CXF-1743
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.1, 2.1.2
>         Environment: Linux, FreeBSD
>            Reporter: R.O.
>
> I have endpoint declared in Spring as follows:
> ---
> 	<jaxws:endpoint id="importService"
> 		implementor="my.ImportServiceImpl"
> 		address="/importService">
> 		<jaxws:properties>
> 			<entry key="mtom-enabled" value="true" />
> 		</jaxws:properties>
> 	</jaxws:endpoint>
> ---
> During tests I discovered, that large attachments (>64k), which are saved in temporary files, are not removed after processing SOAP message.
> I've analysed sources of org.apache.cxf.attachment.AttachmentDataSource and org.apache.cxf.io.CachedOutputStream and discovered that AttachmentDataSource does not allow to close cache. 
> The only solution is to add close() method to AttachmentDataSource and close cache manually.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1743) Temporary files are not deleted

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12621911#action_12621911 ] 

Daniel Kulp commented on CXF-1743:
----------------------------------


What's SUPPOSED to happen is when the input stream is closed, the file is deleted.   This isn't actually working though.   :-(       I'm testing a fix now.



> Temporary files are not deleted
> -------------------------------
>
>                 Key: CXF-1743
>                 URL: https://issues.apache.org/jira/browse/CXF-1743
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.1, 2.1.2
>         Environment: Linux, FreeBSD
>            Reporter: R.O.
>
> I have endpoint declared in Spring as follows:
> ---
> 	<jaxws:endpoint id="importService"
> 		implementor="my.ImportServiceImpl"
> 		address="/importService">
> 		<jaxws:properties>
> 			<entry key="mtom-enabled" value="true" />
> 		</jaxws:properties>
> 	</jaxws:endpoint>
> ---
> During tests I discovered, that large attachments (>64k), which are saved in temporary files, are not removed after processing SOAP message.
> I've analysed sources of org.apache.cxf.attachment.AttachmentDataSource and org.apache.cxf.io.CachedOutputStream and discovered that AttachmentDataSource does not allow to close cache. 
> The only solution is to add close() method to AttachmentDataSource and close cache manually.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.