[jcifs] "incorrect function" exception

Marco Nelissen marco.nelissen at gmail.com
Sat Sep 6 23:07:28 GMT 2008

I'm trying to use JCIFS to talk to a PC running Windows XP that shares
one folder.
I can access this PC and its share just fine from another PC (also
running XP) using "My Network Places", but when I try it with JCIFS
like so:

            String[] shares = new SmbFile("smb://").list();

I get:

: jcifs.smb.SmbException: Incorrect function.
:     at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:551)
:     at jcifs.smb.SmbTransport.send(SmbTransport.java:653)
:     at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:288)
:     at jcifs.smb.SmbSession.send(SmbSession.java:233)
:     at jcifs.smb.SmbTree.treeConnect(SmbTree.java:161)
:     at jcifs.smb.SmbFile.doConnect(SmbFile.java:850)
:     at jcifs.smb.SmbFile.doShareEnum(SmbFile.java:1725)
:     at jcifs.smb.SmbFile.doEnum(SmbFile.java:1673)
:     at jcifs.smb.SmbFile.list(SmbFile.java:1646)
:     at jcifs.smb.SmbFile.list(SmbFile.java:1543)

I also tried just accessing a file on the share directly (instead of
getting a list), and got the same exception.
Anyone know what this "incorrect function" is about? A search on
Google found some references to this happening with older versions of
JCIFS when talking to a NetApp filer, but this is version 1.2.25b
talking to a plain old Windows XP PC.

More information about the jcifs mailing list