[jcifs] NPE in SmbFile.listFiles with 1.2.18

Patrick Madden PatrickMadden at clooster.com
Wed Mar 5 14:42:37 GMT 2008


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/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: listfiles.pcap
Type: application/octet-stream
Size: 7373 bytes
Desc: listfiles.pcap
Url : http://lists.samba.org/archive/jcifs/attachments/20080305/12dcf8d0/listfiles.obj


More information about the jcifs mailing list