Re: NullPointerException at SmbFile.getType()
Michael B Allen <[email protected]>
| Newsgroups | gmane.network.samba.java |
|---|---|
| Message-ID | <CAGMFw4jpAj-7urJdUxNWMWJnDnSS6uaKWXjBS6ZhRtowKT6-KQ@mail.gmail.com> |
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 <[email protected]> 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 >