[solved?] Re: [jcifs] NbtAddress.getByName() failing when I use a hostname.]

Rob Wygand rob at filefish.com
Tue Sep 25 12:19:56 EST 2001


This issue doesn't seem to want to die for me.

I made some changes in my code today in the way that I use JCIFS. 
Particularly, I switched from using the NBT name in the URL to create an 
SmbFile to a domain name. So:

	smb://WORKGROUP;rob:password@pickle/
became
	smb://WORKGROUP;rob:password@pickle.filefish.com/

This worked once or twice, and then started throwing exceptions claiming 
that PICKLE.FILEFISH could not be resolved. You'd said that SmbFile does 
all the magical stuff of resolving hostnames to NBT names, but as soon 
as I changed the URL to use the ip address (via 
InetAddress.getHostAddress()) everything started working again and 
hasn't displayed any problems all day...

Just a heads up,
rjw

Michael B. Allen wrote:
> On Mon, Sep 17, 2001 at 09:51:16AM -0700, Kammy Wesley wrote:
> 
>>We put in ocean.filefish.com.  The NbtAddress is translating that into 
>>"OCEAN.FILEFISH."
>>
> 
> Ahh, it just hit me. That's not a netbios name so you can't use it
> with _NbtAddress). The SmbFile class uses SmbURL to do all that extra name
> resolution stuff with DNS and such. Maybe you can do:
> 
> NbtAddress a = NbtAddress.getByName((new SmbFile( whatevername )).getServer());
> 
> Pretty ugly because it does redundant lookups but the name will resolve
> quickly the second time because it would be cached at that point. If
> you're working withing the jCIFS package you might hook into the name
> resolution code directly. Unfortunately I just don't have the time to
> instruct you guys better.
> 
> Mike
> 






More information about the jcifs mailing list