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 "Ferruh Zamangoer (JIRA)" <ax...@ws.apache.org> on 2005/08/19 12:53:58 UTC

[jira] Created: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
-----------------------------------------------------------------------------------------------------------------

         Key: AXIS-2181
         URL: http://issues.apache.org/jira/browse/AXIS-2181
     Project: Apache Axis
        Type: Bug
  Components: Basic Architecture  
    Versions: 1.2    
 Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
Server Windows 2003 Server, 512 MB.
    Reporter: Ferruh Zamangoer
    Priority: Blocker


Hi, 

we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can’t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.

                        boolean  status = ws.registerContent("trebun", "password", ci); //call service
			System.out.println("status: " + status);
			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
			boolean deleteState = file.delete(); ==> error occurs here?

We cause for the error could be that a Stream are opened and not closed.

FileDataSource fds = new FileDataSource(new File(filename));
                DataHandler contentHandler =
                    new DataHandler(fds
                        );

The scenario can reproduced easily.
1. send and file to a server with attachment
2. After the Call of the webserice try to remove the local file without to shutdown your app.

We are using on the client side the following Java Version:

java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)


-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Jan Pieterse (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12330450 ] 

Jan Pieterse commented on AXIS-2181:
------------------------------------

Is there a relationship with Bugzilla ID 17001?

Jan

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


AW: [jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by Ferruh Zamangoer <fe...@gmx.de>.
Hello Jan,

your workarround works. 

Thanks 
Ferruh
-----Ursprüngliche Nachricht-----
Von: Jan Pieterse (JIRA) [mailto:axis-dev@ws.apache.org] 
Gesendet: Donnerstag, 29. September 2005 10:41
An: axis-dev@ws.apache.org
Betreff: [jira] Commented: (AXIS-2181) After sending an Attachments the
local File can not removed from the filesystem ==> cause File is locked by
axis?

    [
http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12330783
] 

Jan Pieterse commented on AXIS-2181:
------------------------------------

Ferruh, 

Please look at
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/activation/FileDataSourc
e.html#getInputStream() first. 

With "this.is = super.getInputStream();" you will get a new instance
everytime the method is called. Try something like:

if (this.is == null) {
  this.is = super.getInputStream();
}
return is;

Other than this your code looks OK. 

Clemente,

Off course, your right. Maybe your can try reading the file at the server
side in memory (byte[]) and attach this. Afterwards you can delete your
file. It seems
bad practice to make your client responsible of you server file management.

Good luck,

Jan

> After sending an Attachments the local File can not removed from the
filesystem ==> cause File is locked by axis?
>
----------------------------------------------------------------------------
-------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register
these files. The problem which occurred in our scenario is that after we
have send the file we want to delete the local file on the filesystem. But
we can?t delete the file because anything references or blocks the file. We
have localized that the problem occurs in the part after the webservice
call. When we uncomment the the part of the call the removing works. For
sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun",
"password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new
File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error
occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to
shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Jan Pieterse (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12330783 ] 

Jan Pieterse commented on AXIS-2181:
------------------------------------

Ferruh, 

Please look at http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/activation/FileDataSource.html#getInputStream() first. 

With "this.is = super.getInputStream();" you will get a new instance everytime the method is called. Try something like:

if (this.is == null) {
  this.is = super.getInputStream();
}
return is;

Other than this your code looks OK. 

Clemente,

Off course, your right. Maybe your can try reading the file at the server side in memory (byte[]) and attach this. Afterwards you can delete your file. It seems
bad practice to make your client responsible of you server file management.

Good luck,

Jan

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Rodrigo Ruiz (JIRA)" <ax...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS-2181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rodrigo Ruiz updated AXIS-2181:
-------------------------------

    Affects Version/s: 1.3
                       1.2.1
                       current (nightly)

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS-2181
>                 URL: https://issues.apache.org/jira/browse/AXIS-2181
>             Project: Axis
>          Issue Type: Bug
>          Components: Basic Architecture
>    Affects Versions: current (nightly), 1.2.1, 1.3, 1.4
>         Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>            Reporter: Ferruh Zamangoer
>            Priority: Critical
>         Attachments: DimeBodyPart.diff
>
>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Rodrigo Ruiz (JIRA)" <ax...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS-2181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rodrigo Ruiz updated AXIS-2181:
-------------------------------

    Affects Version/s:     (was: 1.2)
                       1.4

The issue is marked as affecting Axis 1.2, but indeed it also affects the latest 1.4 final version.

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS-2181
>                 URL: https://issues.apache.org/jira/browse/AXIS-2181
>             Project: Axis
>          Issue Type: Bug
>          Components: Basic Architecture
>    Affects Versions: 1.4
>         Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>            Reporter: Ferruh Zamangoer
>            Priority: Critical
>         Attachments: DimeBodyPart.diff
>
>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Rodrigo Ruiz (JIRA)" <ax...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS-2181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rodrigo Ruiz updated AXIS-2181:
-------------------------------

    Attachment: DimeBodyPart.diff

This patch closes the DataHandler input stream after using it.

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS-2181
>                 URL: https://issues.apache.org/jira/browse/AXIS-2181
>             Project: Axis
>          Issue Type: Bug
>          Components: Basic Architecture
>    Affects Versions: 1.2
>         Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>            Reporter: Ferruh Zamangoer
>            Priority: Critical
>         Attachments: DimeBodyPart.diff
>
>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Jan Pieterse (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12330467 ] 

Jan Pieterse commented on AXIS-2181:
------------------------------------

Ferruh,

Please look at http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/activation/FileDataSource.html#getInputStream() first. 

I think the Axis development team missed that one. The inputstream isn't closed by the Axis code after the call 'getInputstream' from the datasource. So after the webservice call you will get a new InputStream by calling 'fds.getInputStream()' from the FileDataSource. After closing this inputstream there will still be another which is opened untill finalize is called. Here is a workaround:

Extend FileDataSource with you own FileDataSource class. Override the 'getInputStream()' method. Make sure you return the same instance of
java.io.FileInputStream every time the method (getInputStream()) is called. Give a instance of your 'home-made' FileDataSource 2 the 
DataHandler like:

MyOwnFileDataSource fds = new MyOwnFileDataSource(new File(filename)); 
DataHandler contentHandler =  new DataHandler(fds); 

After calling the webservice close the inputstream with fds.getInputStream and close(). After closing the stream you will be able to delete your file.

Hope it helps,

Jan P.



> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Jan Pieterse (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12330676 ] 

Jan Pieterse commented on AXIS-2181:
------------------------------------

Clemente,

Try closing the inputstream at the server before deletion. 

Jan

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Ferruh Zamangoer (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12330456 ] 

Ferruh Zamangoer commented on AXIS-2181:
----------------------------------------

Hi Jan,

it seems to be the same problem in Bugzilla ID 17001. But I have also try to delete the file after closing the streams it does not work. Davanum means that  he  can't recreate the problem?

Regards
Ferruh

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Jan Pieterse (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12330562 ] 

Jan Pieterse commented on AXIS-2181:
------------------------------------

Clement,

Ferruh and I had problems deleting the file after sending it. Seems to me you are having problems with recieving the file. If you
want to write the file to disk dont close the stream before writing it:

			iter = attachmentsImpl.getAttachments().iterator();
		AttachmentPart atPart = (AttachmentPart) iter.next();
			dh = atPart.getDataHandler();
			is = dh.getInputStream();
			FileOutputStream fos =
				new FileOutputStream(filename.toString());
			while ((len = is .read(buf)) > 0) {
				fos.write(buf, 0, len);
			}

Cheers,

Jan


> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2181?page=all ]

Davanum Srinivas updated AXIS-2181:
-----------------------------------

    Priority: Critical  (was: Blocker)

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Clemente Simonetti (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12330546 ] 

Clemente Simonetti commented on AXIS-2181:
------------------------------------------

Jan,

I have the same problem of Ferruh, I've tried your workaround but doesn't work. Here is my code:

public class MyFileDataSource extends FileDataSource {
	private InputStream is;
	private boolean firstCall;
	
	public MyFileDataSource(File file) {
		super(file);
		firstCall = true;
	}
	
	public InputStream getInputStream() throws java.io.IOException {
		if (firstCall) {
			this.is = super.getInputStream();
			firstCall = false;
		}
		return is;
	}
}


>>>SERVER
DataHandler dhSource = new DataHandler(new MyFileDataSource (downloadFile));


>>>CLIENT
AttachmentPart p = (AttachmentPart) messageAttachments.getAttachmentByReference(fileName);
DataHandler dh = p.getDataHandler();
File attachedFile = new File(dh.getName());
dh.getDataSource().getInputStream().close();

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Clemente Simonetti (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12330683 ] 

Clemente Simonetti commented on AXIS-2181:
------------------------------------------

Jan, 

if I close the inputstream on the server side the download fail, here is the full code:

>>>SERVER
private final String REPOSITORY = "C:\repository";

public void download(java.lang.String fileName) throws java.rmi.RemoteException 
{
   File downloadFile = new File(REPOSITORY+fileName);
   if (!downloadFile.isFile())
      throw new AxisFault("The file "+fileName+" not is in repository.");
   MessageContext msgContext = MessageContext.getCurrentContext();
   Message respMsg = msgContext.getResponseMessage();
   respMsg.getAttachmentsImpl().setSendType(Attachments.SEND_TYPE_DIME);

   MyFileDataSource fds = new MyFileDataSource(downloadFile);
   DataHandler dhSource = new DataHandler(fds);
   System.out.println("The file attached with the response is: "+dhSource.getName());
        
   AttachmentPart replyPart = new AttachmentPart(dhSource);
   replyPart.setContentId(fileName);

   respMsg.addAttachmentPart(replyPart);

   try {
       fds.getInputStream().close();
   } catch (IOException e) {
       throw new RemoteException(e.getMessage(), e);
   }

}


>>>CLIENT
public static void download(String endpoint, String repositoryFile, File destinationDir) 
			throws ServiceException, MalformedURLException, RemoteException
{
   if (repositoryFile == null)
      throw new AxisFault("The name of file to download is NULL.");
		
   Service service = new Service();
   Call call = (Call) service.createCall();
   call = (Call) service.createCall();
   call.setOperationName(new QName(endpoint, "download"));
   call.setTargetEndpointAddress( new java.net.URL(endpoint) );

   //Turn DIME on
   call.setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT, 
        				Call.ATTACHMENT_ENCAPSULATION_FORMAT_DIME);

   call.invoke( new Object[]{ repositoryFile } );
        
   Message respMsg = call.getResponseMessage();
   Attachments messageAttachments = respMsg.getAttachmentsImpl();
   if (null == messageAttachments) {
       throw new AxisFault("No support for attachments.");
   }

   if (messageAttachments.getAttachmentCount() == 0)
       throw new AxisFault("No file received with response");

   AttachmentPart p = (AttachmentPart) messageAttachments.getAttachmentByReference(repositoryFile);

   // move the attached file to the destination directory
   try {
        	DataHandler dh = p.getDataHandler();
			File attachedFile = new File(dh.getName());
			File localFile = new File(destinationDir, repositoryFile);
			dh.getDataSource().getInputStream().close();
			if (localFile.exists())
				if (!localFile.delete())
					throw new AxisFault("Local file already opened, cannot delete.");
			if (!attachedFile.renameTo(localFile))
				throw new AxisFault("Cannot move file to the destination directory.");
		} catch (Exception e) {
			throw new RemoteException(e.getMessage(), e);
		}
}


Clemente.

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Ferruh Zamangoer (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12330707 ] 

Ferruh Zamangoer commented on AXIS-2181:
----------------------------------------

Hi Jan,

I have today try your workarround, but it doesn't work. I don't know if I'am doing something wrong. I have write my own FileDataSource like: 

public class ConfuocoFileDataSource extends FileDataSource
{
  
    InputStream is = null;

    public ConfuocoFileDataSource(String file)
    {
        super(file);
    }

    public InputStream getInputStream()
    {
        try
        {
            this.is = super.getInputStream();
        }
        catch (IOException io)
        {
            io.printStackTrace();
        }
        return is;
    }
}

The web service call: 

ConfuocoFileDataSource cfds = new ConfuocoFileDataSource(
                        contentInfo.getValueByName(
                            AudioFileInfo.PATH_ENTRY));
							
                DataHandler contentHandler =
                    new DataHandler(cfds
                        );

                status =
                    contentService.registerContent(
                        contentHandler,
                        contentInfo,
                        pseudonym,
                        password);
                
               cfds.getInputStream().close(); // after the call closing the stream 

Regards
Ferruh 


> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Rodrigo Ruiz (JIRA)" <ax...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS-2181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489779 ] 

Rodrigo Ruiz commented on AXIS-2181:
------------------------------------

Hi all,

I think I can bring some insight on this issue.

There is a problem in the DimeBodyPart class, specifically in one of its send(...) methods (the one starting at line 319, in Axis 1.4). The method opens the datahandler stream, but it never closes it explicitly. As a result, the inner FileInputStream is not closed until it is garbage collected. In the meantime, attempts to remove or rename the file always file because the file is locked.

I will try to create a patch for this :-)

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS-2181
>                 URL: https://issues.apache.org/jira/browse/AXIS-2181
>             Project: Axis
>          Issue Type: Bug
>          Components: Basic Architecture
>    Affects Versions: 1.2
>         Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>            Reporter: Ferruh Zamangoer
>            Priority: Critical
>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Ferruh Zamangoer (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12319836 ] 

Ferruh Zamangoer commented on AXIS-2181:
----------------------------------------

Hi Davanum, 

do you have reconstructed the problem? Can you tell why this error occurs?.

If you want I can send you my test code.

Regards,

Ferruh

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Jan Pieterse (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12330277 ] 

Jan Pieterse commented on AXIS-2181:
------------------------------------

Hi,

I seem to have the same problem. I've tried closing the inputstream of the FileDataSource. I cannot delete the file, until the
handle is garbage collected.

Regards,





> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12319501 ] 

Davanum Srinivas commented on AXIS-2181:
----------------------------------------

can't recreate the problem. could you please try closing the inputstream of fds (fds.getInputStream())? lowering the priority on this.

-- dims

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Blocker

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-2181) After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?

Posted by "Clemente Simonetti (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2181?page=comments#action_12330575 ] 

Clemente Simonetti commented on AXIS-2181:
------------------------------------------

Jan,

the code that i've posted is fully working, the problem is that after the execution of the client the file that has been downloaded cannot be removed from the server, but it is locked. So I've tried to close the InputStream on the client side but without any success. Sorry for the misunderstanding.

Best regards,

Clemente

> After sending an Attachments the local File can not removed from the filesystem ==> cause File is locked by axis?
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: AXIS-2181
>          URL: http://issues.apache.org/jira/browse/AXIS-2181
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2
>  Environment: Client: Windows 2000, PIII 800 MHz, 512 MB RAM.
> Server Windows 2003 Server, 512 MB.
>     Reporter: Ferruh Zamangoer
>     Priority: Critical

>
> Hi, 
> we are using AXIS WS to send some MP3 files to an server where we register these files. The problem which occurred in our scenario is that after we have send the file we want to delete the local file on the filesystem. But we can?t delete the file because anything references or blocks the file. We have localized that the problem occurs in the part after the webservice call. When we uncomment the the part of the call the removing works. For sending our file as attachment we use the following code lines.
>                         boolean  status = ws.registerContent("trebun", "password", ci); //call service
> 			System.out.println("status: " + status);
> 			File file = new File("MP3/RENCBER_DEWRANO_10_ELE__WWW.MP3"); //delete file
> 			boolean deleteState = file.delete(); ==> error occurs here?
> We cause for the error could be that a Stream are opened and not closed.
> FileDataSource fds = new FileDataSource(new File(filename));
>                 DataHandler contentHandler =
>                     new DataHandler(fds
>                         );
> The scenario can reproduced easily.
> 1. send and file to a server with attachment
> 2. After the Call of the webserice try to remove the local file without to shutdown your app.
> We are using on the client side the following Java Version:
> java version "1.4.2_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
> Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira