[jcifs] NtlmHttpFilter requires username, password and wins server

Michael B Allen mba2000 at ioplex.com
Thu Oct 21 23:23:04 GMT 2004


Panagiotis Korros said:
>
> If I try without a wins server I get the following NullPointerException
> when I try to access a ntlm protected resource.
>
> java.lang.NullPointerException: null address || null buffer
> 	at java.net.PlainDatagramSocketImpl.send(Native Method)
> 	at java.net.DatagramSocket.send(DatagramSocket.java:611)
> 	at
> jcifs.netbios.NameServiceClient.send(NameServiceClient.java:228)
> 	at
> jcifs.netbios.NameServiceClient.getAllByName(NameServiceClient.java:268)
> 	at jcifs.netbios.NbtAddress.getAllByName(NbtAddress.java:451)
> 	at
> jcifs.smb.SmbSession.getChallengeForDomain(SmbSession.java:83)
> 	at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:123)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
> tionFilterChain.java:186)
> ...
>
> I hacked the code and saw that NbtAddress.getAllByName( DOMAIN, 0x1C,
> null, null ) doesn't work without a wins server but
> NbtAddress.getByName( DOMAIN, 0x1C, null, null ) does work. Why is that?

It is because getAllByName did not set the request address to the
broadcast address. When this reached the socket layer it would generate a
null pointer exception. This has been fixed (will be in the next release).
I made it more like getByName in that it will actually try to broadcast
for the domain controller if necessary.

Mike


More information about the jcifs mailing list