[jcifs] UnknownHostException

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Tue Nov 20 11:40:47 EST 2001

> -----Original Message-----
> From:	Bruce Altner [SMTP:baltner at hq.nasa.gov]
> Greetings:
> I am trying to get a list of host machines within a workgroup using 
> SmbFile.list(url) with a url specified this way:
> String url = "smb://"+domain;
> where my domain (workgroup) is specified externally, e.g., from the command 
> line.  When I do this, however, I get
> an UnknownHostException from jcifs-0.6b (see below). Does that mean it is 
> interpreting the workgroup name as a host name?
	If the local master browser (LMB) for a domain is on a *different* subnet jCIFS will not find it. This is sort of a bug given the interface suggests it's supported but the fix involves a
little more code because it has to retrive a list of LMBs from the PDC and then choose an LMB ...etc. But it's actually not that bad, I just don't have packet captures of this process. I will look
into it for the next beta but given the changes that have been made I felt I should hold off on fixing this untill I got back to where we were.

> The url syntax for returning a list of hosts in a workgroup and the list of 
> shares on a host is the same so in this case it must think I'm asking for 
> shares and can't find the host but I'm asking for hosts by specifying the 
> domain.
	There is code in the UniAddress class that can query the network to determine whether or not the name refers to a workgroup name or a server name. All happends under the hood.

>  What am I missing?
	Nothing if the LMB you're querying is on another subnet.

>  Is it something I have to specify with 
> jcifs.Config.setProperty?
> Thanks,
> Bruce
> Exception.getMessage() returns: HQIRMS
	Hmm, well that's not a very informative message. Need to fix that.


More information about the jcifs mailing list