[jcifs] Exception when accessing Smb files from an applet which has been Reloaded

Michael B Allen miallen at ioplex.com
Thu Aug 9 18:40:22 GMT 2007

On Thu, 9 Aug 2007 17:23:41 +0200
Florian.Jirschik at Linde-LE.com wrote:

> Dear All,
> maybe you can help me with this issue. I've got an Java Applet which
> connects to a SMB ressource to list a shared directory's content.
> It is run in the Sun Applet Viewer. If I start the applet for the first
> time or restart it (a menu entry within the Applet Viewer), everything
> works fine.
> But if I reload the applet, the SMB connection fails with this error
> message after a timeout of 30000 ms:
> jcifs.smb.SmbException:
> jcifs.util.transport.TransportException:
> Transport1[T50559<00>/] timedout waiting for response to
> Trans2FindFirst2[command=SMB_COM_TRANSACTION2,received=false,errorCode=0,flags=0x0018,flags2=0xC003,signSeq=0,tid=2048,pid=40562,uid=2048,mid=9,wordCount=15,byteCount=29,totalParameterCount=28,totalDataCount=0,maxParameterCount=10,maxDataCount=65535,maxSetupCount=0,flags=0x00,timeout=0,parameterCount=28,parameterOffset=66,parameterDisplacement=0,dataCount=0,dataOffset=94,dataDisplacement=0,setupCount=1,pad=1,pad1=0,searchAttributes=0x16,searchCount=200,flags=0x00,informationLevel=0x104,searchStorageType=0,filename=\pool\]
>       at jcifs.smb.SmbTransport.send(SmbTransport.java:585)
>       at jcifs.smb.SmbSession.send(SmbSession.java:239)
>       at jcifs.smb.SmbTree.send(SmbTree.java:109)
>       at jcifs.smb.SmbFile.send(SmbFile.java:695)
>       at jcifs.smb.SmbFile.doFindFirstNext(SmbFile.java:1942)
>       at jcifs.smb.SmbFile.doEnum(SmbFile.java:1658)

Hi Florian,

There's not much I can do about this. Basically the client is trying to
read from the socket but the socket has quietly disappeared. It really
would have been more polite for the Applet viewer to throw a "not
connected" exception or something like that. The only way I can think
of getting around this problem would be to add a disconnect method to
SmbFile and call that in the applet deinitialization routine. Either
that or use the ClassLoader to load a new instance of JCIFS classes
thereby forcing a new transport to be created when the applet reloads.


Michael B Allen
PHP Active Directory Kerberos SSO

More information about the jcifs mailing list