I've been using jcifs 1.3.17 for quite some time, and recently had some troubles enumerating shares from one specific NetApp machine.
I can post the network captures (pcap file) if necessary.
exception is:
jcifs.util.transport.TransportException: Transport2 timedout waiting for response to SmbComReadAndX[command=SMB_COM_READ_ANDX,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=1,pid=17493,uid=1,mid=16,wordCount=12,byteCount=0,andxCommand=0xFF,andxOffset=0,fid=1,offset=7352,maxCount=1024,minCount=1024,openTimeout=-1,remaining=1024,offset=7352]
at jcifs.util.transport.Transport.sendrecv(Transport.java:73)
at jcifs.smb.SmbTransport.send(SmbTransport.java:655)
at jcifs.smb.SmbSession.send(SmbSession.java:255)
at jcifs.smb.SmbTree.send(SmbTree.java:113)
at jcifs.smb.SmbFile.send(SmbFile.java:792)
at jcifs.smb.SmbFileInputStream.readDirect(SmbFileInputStream.java:181)
at jcifs.dcerpc.DcerpcPipeHandle.doReceiveFragment(DcerpcPipeHandle.java:99)
at jcifs.dcerpc.DcerpcHandle.sendrecv(DcerpcHandle.java:220)
at jcifs.smb.SmbFile.doMsrpcShareEnum(SmbFile.java:1938)
at jcifs.smb.SmbFile.doShareEnum(SmbFile.java:1851)
at jcifs.smb.SmbFile.doEnum(SmbFile.java:1797)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1773)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1762)
at com.mprv.filecrawler.cifs.SmbRootCrawler.listDirectories(SmbRootCrawler.java:32)
at com.mprv.filecrawler.cifs.SmbDirCrawler.crawl(SmbDirCrawler.java:62)
at com.mprv.filecrawler.cifs.SmbDirCrawler.init(SmbDirCrawler.java:38)
at com.mprv.filecrawler.DirTask.run(DirTask.java:41)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
netShareEnum response status=50
netShareEnum response=NetShareEnumResponse[command=SMB_COM_TRANSACTION,received=false,errorCode=0,flags=0x0098,flags2=0xC801,signSeq=0,tid=1,pid=17493,uid=1,mid=5,wordCount=10,byteCount=5,totalParameterCount=4,totalDataCount=0,parameterCount=4,parameterOffset=56,parameterDisplacement=0,dataCount=0,dataOffset=60,dataDisplacement=0,setupCount=0,pad=1,pad1=0,status=50,converter=0,entriesReturned=16,totalAvailableEntries=0]
jcifs.smb.SmbException: 50
at jcifs.smb.SmbFile.doNetShareEnum(SmbFile.java:1961)
at jcifs.smb.SmbFile.doShareEnum(SmbFile.java:1855)
at jcifs.smb.SmbFile.doEnum(SmbFile.java:1797)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1773)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1762)
at com.mprv.filecrawler.cifs.SmbRootCrawler.listDirectories(SmbRootCrawler.java:32)
at com.mprv.filecrawler.cifs.SmbDirCrawler.crawl(SmbDirCrawler.java:62)
at com.mprv.filecrawler.cifs.SmbDirCrawler.init(SmbDirCrawler.java:38)
at com.mprv.filecrawler.DirTask.run(DirTask.java:41)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
UPDATE: according to pcap files, it seems that in some point, when receiving a big amount of shares, the JCIFS stops asking for more packets (SmbComReadAndX) after a Dcerpc fragment.
it seems that the problem was the amount of shares on the server (~250 shares) Jcifs buffer was raised from 1024 to 4280 bytes.