timeout exception

View: New views
3 Messages — Rating Filter:   Alert me  

timeout exception

by jiang ding :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 I am trying to copy a huge local file, size is 1.4G to a remote windows.

Here is my code:

  smbFile = new SmbFile(remoteSmbUrl);

  BufferedInputStream in  = new BufferedInputStream(localFile);

  BufferedOutputStream out = new BufferedOutputStreram(smbFile.getOutputStream());

   byte[] buffer = new byte[10240];

    int len = 0;

   while((len = in.read(buffer))>0){

out.write(buffer,0,len);

}

out.close()///here throw the below exception

 

jcifs.smb.SmbException: Transport1 timedout waiting for response to SmbComClose[command=SMB_COM_CLOSE,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=2049,pid=51602,uid=2049,mid=12445,wordCount=3,byteCount=0,fid=16385,lastWriteTime=0]

jcifs.util.transport.TransportException: Transport1 timedout waiting for response to SmbComClose[command=SMB_COM_CLOSE,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=2049,pid=51602,uid=2049,mid=12445,wordCount=3,byteCount=0,fid=16385,lastWriteTime=0]

    at jcifs.util.transport.Transport.sendrecv(Transport.java:76)

    at jcifs.smb.SmbTransport.send(SmbTransport.java:634)

    at jcifs.smb.SmbSession.send(SmbSession.java:224)

    at jcifs.smb.SmbTree.send(SmbTree.java:111)

    at jcifs.smb.SmbFile.send(SmbFile.java:770)

    at jcifs.smb.SmbFile.close(SmbFile.java:1009)

    at jcifs.smb.SmbFile.close(SmbFile.java:1015)

    at jcifs.smb.SmbFile.close(SmbFile.java:1019)

    at jcifs.smb.SmbFileOutputStream.close(SmbFileOutputStream.java:164)

   at java.io.FilterOutputStream.close(FilterOutputStream.java:143)

    at com.tier3.filetrans.SambaFileUploader.push(SambaFileUploader.java:89)

    at com.tier3.filetrans.SambaFileUploader.main(SambaFileUploader.java:126)

 

    at jcifs.smb.SmbTransport.send(SmbTransport.java:641)

    at jcifs.smb.SmbSession.send(SmbSession.java:224)

    at jcifs.smb.SmbTree.send(SmbTree.java:111)

    at jcifs.smb.SmbFile.send(SmbFile.java:770)

    at jcifs.smb.SmbFile.close(SmbFile.java:1009)

    at jcifs.smb.SmbFile.close(SmbFile.java:1015)

    at jcifs.smb.SmbFile.close(SmbFile.java:1019)

    at jcifs.smb.SmbFileOutputStream.close(SmbFileOutputStream.java:164)

   at java.io.FilterOutputStream.close(FilterOutputStream.java:143)

    at com.tier3.filetrans.SambaFileUploader.push(SambaFileUploader.java:89)

    at com.tier3.filetrans.SambaFileUploader.main(SambaFileUploader.java:126)

 


Parent Message unknown Re: timeout exception

by Michael B Allen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Oct 6, 2009 at 12:03 AM, jiang ding <jiang.d@...> wrote:

> Hi,
>
>  I am trying to copy a huge local file, size is 1.4G to a remote windows.
>
> Here is my code:
>
>   smbFile = new SmbFile(remoteSmbUrl);
>
>   BufferedInputStream in  = new BufferedInputStream(localFile);
>
>   BufferedOutputStream out = new
> BufferedOutputStreram(smbFile.getOutputStream());

Hi Jiang,

You do not need to use Buffer{Input,Output}Stream. In fact it will
probably just slow things down. Just use FileInputStream with the
OutputStream of SmbFile directly.

> jcifs.smb.SmbException: Transport1 timedout waiting for response to
> SmbComClose[command=SMB_COM_CLOSE,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=2049,pid=51602,uid=2049,mid=12445,wordCount=3,byteCount=0,fid=16385,lastWriteTime=0]
>
> jcifs.util.transport.TransportException: Transport1 timedout waiting for
> response to

Try setting jcifs.smb.client.responseTimeout = 120000. This is 4 x the
default of 30 seconds. The file server is probably trying to do
something on close that is causing the response to take a long time.
If it still happends after waiting 2 minutes, I don't know what the
problem is.

Mike

--
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/

Parent Message unknown Re: timeout exception

by Michael B Allen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok. In the future please always CC the JCIFS mailing list for
posterity (as I have just done).

On Tue, Oct 6, 2009 at 8:00 PM, jiang ding <jiang.d@...> wrote:

> Hi Michael,
>  At last I find out the reason of the timeout. It is the realtime antivirus
> software in my target windows host. Unfortunately the file I was
> transferring by jcifs contains a virus. So the antivirus software in the
> target windows did some actions against the virus.
>  I tried another big file, it works like a charm.
>
> Thanks for your time.
>
> Jiang.
>
> -----Original Message-----
> From: Michael B Allen [mailto:ioplex@...]
> Sent: Wednesday, 7 October 2009 7:34 AM
> To: jiang ding
> Cc: jcifs@...
> Subject: Re: [jcifs] timeout exception
>
> On Tue, Oct 6, 2009 at 12:03 AM, jiang ding <jiang.d@...> wrote:
>> Hi,
>>
>>  I am trying to copy a huge local file, size is 1.4G to a remote windows.
>>
>> Here is my code:
>>
>>   smbFile = new SmbFile(remoteSmbUrl);
>>
>>   BufferedInputStream in  = new BufferedInputStream(localFile);
>>
>>   BufferedOutputStream out = new
>> BufferedOutputStreram(smbFile.getOutputStream());
>
> Hi Jiang,
>
> You do not need to use Buffer{Input,Output}Stream. In fact it will
> probably just slow things down. Just use FileInputStream with the
> OutputStream of SmbFile directly.
>
>> jcifs.smb.SmbException: Transport1 timedout waiting for response to
>>
> SmbComClose[command=SMB_COM_CLOSE,received=false,errorCode=0,flags=0x0018,fl
> ags2=0xC803,signSeq=0,tid=2049,pid=51602,uid=2049,mid=12445,wordCount=3,byte
> Count=0,fid=16385,lastWriteTime=0]
>>
>> jcifs.util.transport.TransportException: Transport1 timedout waiting for
>> response to
>
> Try setting jcifs.smb.client.responseTimeout = 120000. This is 4 x the
> default of 30 seconds. The file server is probably trying to do
> something on close that is causing the response to take a long time.
> If it still happends after waiting 2 minutes, I don't know what the
> problem is.
>
> Mike
>
> --
> Michael B Allen
> Java Active Directory Integration
> http://www.ioplex.com/
>
>



--
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/