[jcifs] NullPointerException at jcifs.netbios.NbtAddress

Michael B Allen mba2000 at ioplex.com
Thu Mar 23 20:01:47 GMT 2006

>From looking at the code it looks like InetAddress.getLocalHost is
returning null. I don't recall off the top of my head why this occurs
but it has to do with the local system cofiguration. Try:

$ hostname

on both systems and see if you see an inconsistency. I think if it returns
'localhost' or '' that will cause problems with JCIFS. One way
to hack around this is to add an entry in /etc/hosts.

Search the archives on google like:

  site:http://lists.samba.org/ jcifs localhost NullPointerException



On Tue, 21 Mar 2006 13:27:27 -0500
dhillenb at lexmark.com wrote:

> I was hoping for some direction on this problem.  I have machines that are 
> sitting right next to each other
> on the same net accessing the same share. Most work but some get the 
> Nullpointer below.
> JVM - General Failure, rc=1
> Unhandled error on thread UI Applet
> java.lang.ExceptionInInitializerError: java.lang.NullPointerException
>  at java.lang.Throwable.(Throwable.java:54)
>  at java.lang.Throwable.(Throwable.java:68)
>  at java.lang.NullPointerException.(NullPointerException.java:42)
>  at jcifs.netbios.NbtAddress.(NbtAddress.java:199)
>  at java.lang.Class.initializeImpl(Native Method)
>  at java.lang.Class.initialize(Class.java:326)
>  at jcifs.UniAddress.(UniAddress.java:62)
>  at java.lang.Class.initializeImpl(Native Method)
>  at java.lang.Class.initialize(Class.java:326)
>  at jcifs.smb.SmbFile.getAddress(SmbFile.java:757)
>  at jcifs.smb.SmbFile.connect(SmbFile.java:785)
>  at jcifs.smb.SmbFile.connect0(SmbFile.java:762)
>  at jcifs.smb.SmbFile.getType(SmbFile.java:1115)
>  at jcifs.smb.SmbFile.canRead(SmbFile.java:1289)
> I have compared configs and  have trouble seeing any differences.  I seems 
> things do not work at all without
> a Dns server even when using Ip address.  I have seen trouble when  using 
> a static Ip address . Any explanation of the sequence of events when 
> trying to resolve a name would be appreciated. 

More information about the jcifs mailing list