[jcifs] Reconnecting after Win2000 shares fails

Michael B Allen mba2000 at ioplex.com
Thu Apr 7 23:19:13 GMT 2005

Michael B Allen said:
>> I have a desktop share that I test connecting to a file repeatedly.
>> Then, I disable this share.  Errors come up as normal. Then I re-enable
>> share. Still errors....
> <snip>
>> Caused by: jcifs.smb.SmbException: 0xC00000C9
>> 	at jcifs.smb.SmbTransport.sendTransaction(SmbTransport.java:861)
>> 	at jcifs.smb.SmbSession.sendTransaction(SmbSession.java:246)
>> 	at jcifs.smb.SmbTree.sendTransaction(SmbTree.java:74)
>> 	at jcifs.smb.SmbFile.sendTransaction(SmbFile.java:689)
>> 	at jcifs.smb.SmbFile.queryPath(SmbFile.java:1230)
>> 	at jcifs.smb.SmbFile.exists(SmbFile.java:1285)
> I think we just need a try/catch in SmbTree.{send,sendTransaction}
> to trap NT_STATUS_NETWORK_NAME_DELETED and call treeDisconnect( true ).

I've added this fix to my current dev branch and verified it works. You
could add this the following to the end of SmbTree.send and

        try {
            session.send( request, response );
        } catch( SmbException se ) {
            if (se.getNtStatus() == 0xC00000C9) {
                treeDisconnect( true );
            throw se;

I think it should work for stock 1.1.9.


More information about the jcifs mailing list