[jcifs] NullPointerException at SmbFile.getType()

Michael B Allen ioplex at gmail.com
Tue Mar 13 18:39:38 MDT 2012


Hi rmillet,

Actually I would not be surprised to find that the server or share is
"special" in some way and that the NPE does not really happen with a
vanilla server like Windows and one of the usual share types like a
file share or printer.

But even if I cannot reproduce the problem I should be able to at
least make the code either ignore the null service or do something
more meaningful than throw an NPE.

I have added this to the TODO list.

Thanks for the feedback.

Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/


On Mon, Mar 12, 2012 at 2:59 PM, rmillet <rmillet42+jcifs at gmail.com> wrote:
> Hi,
>
> When i want to get the type of a share, the following code produces a
> NullPointerException:
>
> new SmbFile("smb://MYSERVER/share/", auth).getType()
>
> Exception in thread "main" java.lang.NullPointerException
>    at jcifs.smb.SmbFile.getType(SmbFile.java:1285)
>    ....
>
> Null-object is "service" ("this.tree.service")
>
> It happens when when the auth given contains invalid credentials.
> Remote server: Debian with samba 3.4.7.
> JCIFS: 1.3.17 patched with GetOwnerSid.patch
>
>
> --
> rmillet
>


More information about the jCIFS mailing list