[jcifs] Problems with Wins Resolution

Michael B. Allen miallen at eskimo.com
Wed Sep 25 05:22:47 EST 2002


On Tue, 24 Sep 2002 11:52:24 -0500
"Christopher R. Hertel" <crh at ubiqx.mn.org> wrote:

> On Tue, Sep 24, 2002 at 06:08:45PM +0200, andrea.lanza at frameweb.it wrote:
> > Hi, I am new to jcifs...(pls. don't be too severe with me !)
> > 
> > I succeded in developing a servlet to browse my network via browser.
> > 
> > My problem is this: if I query for an host or a domain name or a group name
> > registered in Wins server , everything is OK
> 
> Okay...
> 
> > But if I just query for smb:// in order to obtain the list of workgroups
> > from the master browser, I only get a:
> > 
> > java.net.UnknownHostException: ..__MSBROWSE__.<01>
> 
> That means that there is no Local Master Browser--for any
> workgroup/NT-Domain--on the subnet on which the webserver is located.
> 
> > In my WINS Server I see the rigth entry, registered with the correct 16th
> > character of the NetBIOS name.
> 
> Which right entry?  Which suffix?
> You may see the \01\02__MSBROWSE__\02<01> name listed in the WINS 
> database, but it will have an IP address of 255.255.255.255.
> 
> If you use the SMB:// URL string, the client (jCIFS in this case) is 
> given no default workgroup/NT-Domain to query.  The only thing it can do 
> is to query the local LAN and the only name it knows to look for is 
> \01\02__MSBROWSE__\02<01>.  If there are no Local Master Browers on the 
> local LAN, then it won't find any node to ask and it will return the 
> exeption you saw.
> 
> > Moreover, If I query a workgroup name or a domain name or an host name, I
> > see the statistics increasing in my wins server (number of total query,
> > number of resolved query, ...)
> > 
> > But if I query the master browser nothing happens, there is no increase,
> > and I assume that no queries are sent to and/or received from the wins
> > server.
> 
> Sending a query to the WINS server for the \01\02__MSBROWSE__\02<01> name
> is pointless, since it is a group name and WINS (incorrectly, but
> consistently) will return 255.255.255.255.  Mike may have built in a
> short-cut to prevent jCIFS from wasting time querying for this name.
> 
> Likewise, the workgroup<1D> name is a "special case".  WINS never answers
> query for the Local Master Browser name.  It's a kludge, but it's what
> WINS does.  Samba does it to, just to be WINS compatible.  Again, Mike may 
> have added a short-cut to prevent queries to WINS for the <1D> name, since 
> they always return Name Not Found.
> 
> [Mike:  Just a note... If the client is operating in P mode, then it 
>         *cannot* find the LMB.  A node in P mode will never be able to
>         resolve "SMB://" unless there is a default workgroup defined 
>         somewhere outside of the URL string itself, in which case the
>         client can query the DMB.]
> 
> You might be able to solve the problem by setting the
> jcifs.smb.client.domain property to point to a PDC (any PDC) in your
> network.

jcifs.smb.client.domain is only used for authentication but this brings
up a good point. We could have a jcifs.netbios.workgroup parameter to
use with the 0x1d query. I don't think we do that now. It might work
with jcifs.smb.client.domain but I don't recall.

> 
> Mike: correct me if I'm wrong, but by setting this property I *think* that
>       jCIFS will be able to contact the DMB for the given NT-Domain.  If
>       my guess is right (remembering some now-ancient e'mails on the
>       list), if the NT-Domain is set jCIFS will try querying the Domain
>       Master Browser (the <1B> name) for the browse list.

That is only if you specify a workgroup/server name so it doesn't apply
to the 'smb://' only case.

If you specify 'smb://foo', to find out what 'foo' is it will query for
that name with 0x1b if you specify WINS and 0x1d if you don't. It also
looks for the 0x20 name in concert:

  static NbtAddress lookupServerOrWorkgroup( String name, InetAddress svr )
                                              throws UnknownHostException {
      Object lock = new Object();
      int type = svr == nbns ? 0x1b : 0x1d; 
      QueryThread q1x = new QueryThread( lock, name, type, null, svr );
      QueryThread q20 = new QueryThread( lock, name, 0x20, null, svr );

> 
> > I try to configure the wins property in two ways:
> > 1st  way) setting -Dwins=192.168.69.6  argument in my java servlet engine
> > (I am using IBM WebSphere 3.5.6)
> > 2nd way) using      jcifs.Config.setProperty("jcifs.netbios.wins",
> > "192.168.69.6")  BEFORE using any other jcifs class
> >
> > no matter the way, the result is the same.
> 
> The problem isn't in your WINS setup.  It's the broken design of CIFS
> browsing system that is tripping you up.

AKA you don't have a local master browser (..__MSBROWSE__.<01>) to
give you the list of domains Andrea. MS clients are installed with a
'workgroup' name that they can use to find a domain master browser in
which case it doesn't need to look fot the LMB.

-- 
A  program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes  the  potential  for it to be applied to tasks that are
conceptually  similar and more importantly to tasks that have not
yet been conceived. 



More information about the jcifs mailing list