[jcifs] jcifs.smb.SmbException: The handle is invalid

Michael B Allen ioplex at gmail.com
Sat May 8 17:50:08 MDT 2010


Hi Mathi,

Try examples/Put.java and do not set any properties at all (you can
pass the domain / account name / password in the URL from the
commandline. Does that also reproduce the "handle is invalid"
exception?

If yes, get a packet capture of the error and send it to me directly
as an attachment. I'm not sure what capture programs are available for
AIX but there's probably something like tcpdump. Otherwise you could
run the capture from the Windows side.

Mike

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


On Fri, May 7, 2010 at 3:24 AM, Mathi <mathi at oxseed.com> wrote:
> Hi
>
> I am getting jcifs.smb.SmbException: The handle is invalid while copying
> a file from AIX to windows share directory. This error occurs in the middle
> of copying.
>
>    byte[] b = new byte[4096];
>    int i=0;
>
>    SmbFile file = new SmbFile(url);
>    OutputStream out = new SmbFileOutputStream(file);
>    BufferedInputStream bis = new BufferedInputStream(is);
>    while ((i = bis.read(b)) != -1) {
>        out.write(b, 0, i);
>    }
>
> out.write() throws "handle is invalid" exception after some iterations.
> Stack trace(JCIFS 1.3.12):
> jcifs.smb.SmbException: The handle is invalid.
>        at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:542)
>        at jcifs.smb.SmbTransport.send(SmbTransport.java:644)
>        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.SmbFileOutputStream.writeDirect(SmbFileOutputStream.java:245)
>        at jcifs.smb.SmbFileOutputStream.write(SmbFileOutputStream.java:216)
>
>
> I am using JCIFS 1.3.12 in the production.
> 1. I tried with JCIFS 1.3.14, but it also gives same error.
> 2. I tried  with following config(5minutes timeout), but still I get same error.
>                jcifs.Config.setProperty( "jcifs.smb.client.soTimeout", "300000");
>                jcifs.Config.setProperty( "jcifs.smb.client.responseTimeout", "300000");
>                jcifs.Config.setProperty( "jcifs.netbios.soTimeout", "300000");
>
> Sometimes I get "Handle is invalid" error while reading file from Windows share
> directory.
>
> Could you please help?
>
> Thank you
> Regards
> Mathi
>
>


More information about the jCIFS mailing list