[jcifs] NullPointerException when doing SmbFile.listFiles()

Michael B Allen ioplex at gmail.com
Thu Mar 5 16:44:07 GMT 2009

On Thu, Mar 5, 2009 at 10:19 AM, Arjan van der Veen
<avdveen at palanthir.nl> wrote:
>         smbFile = new SmbFile(smbFile.getParent(), auth);
>         smbFile.list();
> The reading of the file works perfect, the listing of the subfile of a
> directory results in the following stacktrace:
> Testcase:
> testInitialCrawling(nl.palanthir.enterprise.indexer.CifsCrawlerTest):
>  Caused an ERROR
> null
> java.lang.NullPointerException
>         at
> jcifs.smb.ServerMessageBlock.writeString(ServerMessageBlock.java:213)
>         at
> jcifs.smb.ServerMessageBlock.writeString(ServerMessageBlock.java:202)
>         at
> jcifs.smb.Trans2FindNext2.writeParametersWireFormat(Trans2FindNext2.java:67)
>         at
> jcifs.smb.SmbComTransaction.nextElement(SmbComTransaction.java:121)
>         at jcifs.smb.SmbTransport.send(SmbTransport.java:577)

Looks like a bug. Somehow the filename is becoming null.

I've made a note of it. Will fix.


Michael B Allen
Java Active Directory Integration

More information about the jcifs mailing list