[jcifs] NPE in SmbFile.listFiles with 1.2.18

Patrick Madden PatrickMadden at clooster.com
Thu Mar 6 08:39:11 GMT 2008


Hi Michael,

I very much appreciate that you took the time to understand this issues.

FYI, I have 19 shares on a Windows 2003 server. Is that considered "too
many"? I really have no idea.

The 1.2.17 codebase has no problems handling this test case. So
something has changed leading up to 1.2.18. 

In fact this code is not critical to my use of JCifs at all. It was just
something I ran into via unit testing. 

Anyway, it's not too often that I get to help out the open source
community that has so often helped me. Therefore, keep me in the loop
and if I can help to unit test the "fix" when its available just let me
know.

Again,

Thanks very much,

PVM


-----Original Message-----
From: Michael B Allen [mailto:miallen at ioplex.com] 
Sent: Wednesday, March 05, 2008 11:26 PM
To: Patrick Madden
Cc: jcifs at lists.samba.org
Subject: Re: [jcifs] NPE in SmbFile.listFiles with 1.2.18

This is a bug. The server has so many shares it is sending a
multi-fragment response which for some reason JCIFS seems to be having
a problem with. I'll try to get this fixed for the next release.

On Wed, 5 Mar 2008 09:42:37 -0500
"Patrick Madden" <PatrickMadden at clooster.com> wrote:

> Hi Michael,
> 
> Thanks for your help and sorry for late response on this.
> 
> I set it to log level three and just copied the ListFiles.java into my
> unit test package for jcifs
> 
> Here is the output from the log:
> doConnect: Clooster.local/10.10.10.2
> doConnect: 0.0.0.0<00>/10.10.10.2
> open0: \srvsvc
> close: 49219
> Exception in thread "main" java.lang.NullPointerException
> 	at jcifs.smb.SmbShareInfo.hashCode(SmbShareInfo.java:64)
> 	at java.util.HashMap.getEntry(Unknown Source)
> 	at java.util.HashMap.containsKey(Unknown Source)
> 	at jcifs.smb.SmbFile.doShareEnum(SmbFile.java:1697)
> 	at jcifs.smb.SmbFile.doEnum(SmbFile.java:1652)
> 	at jcifs.smb.SmbFile.listFiles(SmbFile.java:1631)
> 	at jcifs.smb.SmbFile.listFiles(SmbFile.java:1564)
> 	at com.clooster.jcifs.ListFiles.main(ListFiles.java:53)
> 
> Also, I'm attaching a pcap file of the wireshark capture during the
run
> using a filter of port 137 || 138 || 139 || 445. Let me know if this
is
> not the correct format and I'll resend quickly this time.
> 
> My Windows 2003 Server is IP 10.10.10.2 and my Client Machine is
> 10.10.10.114
> 
> Thanks in advance!
> 
> PVM
> 
> -----Original Message-----
> From: Michael B Allen [mailto:miallen at ioplex.com] 
> Sent: Tuesday, March 04, 2008 12:08 PM
> To: Patrick Madden
> Cc: jcifs at lists.samba.org
> Subject: Re: [jcifs] NPE in SmbFile.listFiles with 1.2.18
> 
> On Tue, 4 Mar 2008 10:30:33 -0500
> "Patrick Madden" <PatrickMadden at clooster.com> wrote:
> 
> > Hi, 
> > 
> > I just upgraded my code to jcifs 1.2.18 from 1.2.17 and was running
> > through some unit test code and ran into some issues.
> > 
> > For example the SmbFile.listFiles() method throws a NPE when trying
to
> > use the DFS capabilities explained on the jcifs home page
> > 
> > Assume I have a valid NTLMAuthentication instance when I call the
> > following code:
> > 
> > SmbFile smbHost = new SmbFile("smb://foo.local/", ntlmAuth);
> > 
> > SmbFile[] allShares = smbHost.listFiles();
> > 
> > java.lang.NullPointerException
> > 	at jcifs.smb.SmbShareInfo.hashCode(SmbShareInfo.java:64)
> > 	at java.util.HashMap.getEntry(Unknown Source)
> > 	at java.util.HashMap.containsKey(Unknown Source)
> > 	at jcifs.smb.SmbFile.doShareEnum(SmbFile.java:1697)
> > 	at jcifs.smb.SmbFile.doEnum(SmbFile.java:1652)
> > 	at jcifs.smb.SmbFile.listFiles(SmbFile.java:1631)
> > 	at jcifs.smb.SmbFile.listFiles(SmbFile.java:1564)
> > 	at
> > com.clooster.jcifs.SmbFileTest.listShares(SmbFileTest.java:140)
> > 	at com.clooster.jcifs.SmbFileTest.testDFS(SmbFileTest.java:75)
> > 	at com.clooster.jcifs.SmbFileTest.main(SmbFileTest.java:159)
> > 
> > The value of netname in the SmbShareInfo is null.
> > 
> > Anyone have any ideas?
> 
> Hi Patrick,
> 
> I don't see how netName can be null unless some kind of fundamental
> error is going on under the hood.
> 
> Please send the log of examples/ListFiles.java with
> jcifs.util.loglevel=3.
> 
> Also a capture would be great [1].
> 
> Mike
> 
> [1] http://jcifs.samba.org/capture.html
> 
> -- 
> Michael B Allen
> PHP Active Directory SPNEGO SSO
> http://www.ioplex.com/
> 


-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/


More information about the jcifs mailing list