[jcifs] The handle is invalid

Michael B Allen mba2000 at ioplex.com
Wed Feb 16 19:18:27 GMT 2005


On Wed, 16 Feb 2005 13:52:13 +0000 (UTC)
Manfred Meyer <manfred.meyer at outline.ch> wrote:

> Most of the time this works fine but 
> occasionally writing to the server fails with a SmbException 
> "The handle is invalid". 
<snip>
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.
> 	run(ThreadPool.java:677)
>         at java.lang.Thread.run(Thread.java:534)
> Caused by: jcifs.smb.SmbException: The handle is invalid.
>         at jcifs.smb.SmbTransport.send(SmbTransport.java:698)
>         at jcifs.smb.SmbSession.send(SmbSession.java:259)
>         at jcifs.smb.SmbTree.send(SmbTree.java:103)
>         at jcifs.smb.SmbFile.send(SmbFile.java:725)
>         at jcifs.smb.SmbFile.close(SmbFile.java:896)
>         at jcifs.smb.SmbFile.close(SmbFile.java:902)
>         at jcifs.smb.SmbFile.close(SmbFile.java:906)
>         at
>         jcifs.smb.SmbFileOutputStream.close(SmbFileOutputStream.java:162)
>         at
>         com.outline.outputcenter.interfaces.jobreceiver.JobReceiverServic
>         e.
> 					saveAttachments(JobReceiverService.java:327)
>         at
>         com.outline.outputcenter.interfaces.jobreceiver.JobReceiverServic
>         e.
>         	doPost(JobReceiverService.java:121)
>         ... 41 more

This is issuing a close on a disconnected transport. So the client
builds a new transport to send the close which of course makes no sense
but that's generic programming for ya. I think your socket is being
clobbered somehow.

You really need to isolate the problem enough so that you can get a
packet capture [1] of the problem happening from connect to disconnect
and not just the part where it issues the close on the dead connection --
the interesting part has already happend by then.

Also, check the Samba logs. It could be that jcifs said or did something
Samba didn't like.

Also, try running the whole ball of wax against a Windows 2000/3 machine.

Mike

[1] http://jcifs.samba.org/capture.html

-- 
IRC - where men are men, women are men, and the boys are FBI agents.


More information about the jcifs mailing list