[jcifs] InetAddress.getLocalHost easily fails and causes an NPE in NbtAddress

Michael B Allen miallen at ioplex.com
Wed Feb 6 03:34:34 GMT 2008


This NPE has been fixed in 1.2.18 to be released RSN.

Note that this the fix doesn't actually come up with the correct local
host address. If InetAddress.getLocalHost throws an exception there's no
way to determine the localhost. It's basically a host config issue. The
"fix" is to use an InetAddress of 127.0.0.1 which means some things may
not work correctly (although it might help to set the 'laddr'
properties).

Mike

On Wed, 30 Jan 2008 14:42:09 -0500
> ----- Root Cause -----
> java.lang.ExceptionInInitializerError
> 	at jcifs.UniAddress.<clinit>(UniAddress.java:62)
> 	at jcifs.smb.SmbFile.getFirstAddress(SmbFile.java:775)
> 	at jcifs.smb.SmbFile.getAddress(SmbFile.java:742)
> 	at jcifs.smb.SmbFile.getType(SmbFile.java:1210)
> 	at com.metacarta.crawler.connectors.sharedrive.SharedDriveConnector.check(SharedDriveConnector.java:963)
> ...
> 
> Caused by: java.lang.NullPointerException
> 	at jcifs.netbios.NbtAddress.<clinit>(NbtAddress.java:199)
> 	... 43 more

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


More information about the jcifs mailing list