[jcifs] New user questions

Tony Thompson tony.thompson at stone-ware.com
Sat Mar 16 12:51:44 EST 2002


Chris,

>From what I can tell, I do have a browser on my server.  BTW, the trace I sent was one that I had not configured to use a WINS server.  Attached is a trace when specifying a WINS server.

O:\jcifs_0.6.1\examples>nbtstat -n

Local Area Connection:
Node IpAddress: [192.168.0.8] Scope Id: []

                NetBIOS Local Name Table

       Name               Type         Status
    ---------------------------------------------
    BEECH          <00>  UNIQUE      Registered
    BEECH          <20>  UNIQUE      Registered
    LOCALHOST      <00>  GROUP       Registered
    LOCALHOST      <1C>  GROUP       Registered
    LOCALHOST      <1B>  UNIQUE      Registered
    BEECH          <03>  UNIQUE      Registered
    BEECH$         <03>  UNIQUE      Registered
    INet~Services  <1C>  GROUP       Registered
    IS~BEECH.......<00>  UNIQUE      Registered
    LOCALHOST      <1E>  GROUP       Registered
    ADMINISTRATOR  <03>  UNIQUE      Registered
    LOCALHOST      <1D>  UNIQUE      Registered
    ..__MSBROWSE__.<01>  GROUP       Registered

O:\jcifs_0.6.1\examples>

********************************************************
Trace with WINS
********************************************************
O:\jcifs_0.6.1\examples>java -Dlog=all -Djcifs.netbios.wins=192.168.0.8 -cp ..\j
cifs-0.6.1.jar;. SmbShell

......................

Mar 15 20:47:56.027 - name service address cache
 0.0.0.0<00> 0.0.0.0<00>/0.0.0.0
 JCIFS0_8_FB<20> JCIFS0_8_FB<20>/192.168.0.8

Mar 15 20:47:56.037 - nbt name service packet sent
NameQueryRequest[nameTrnId=1,isResponse=false,opCode=QUERY,isAuthAnswer=false,is
Truncated=false,isRecurAvailable=false,isRecurDesired=true,isBroadcast=true,resu
ltCode=0,questionCount=1,answerCount=0,authorityCount=0,additionalCount=0,questi
onName=..__MSBROWSE__.<01>,questionType=0x0020,questionClass=IN,recordName=null,
recordType=0x0000,recordClass=0x0000,ttl=0,rDataLength=0]
Mar 15 20:47:56.047 - datagram packet sent to: 255.255.255.255
00000: 00 01 01 10 00 01 00 00 00 00 00 00 20 41 42 41  |............ ABA|
00010: 43 46 50 46 50 45 4E 46 44 45 43 46 43 45 50 46  |CFPFPENFDECFCEPF|
00020: 48 46 44 45 46 46 50 46 50 41 43 41 42 00 00 20  |HFDEFFPFPACAB.. |
00030: 00 01                                            |..              |

Mar 15 20:47:59.051 - nbt name service packet sent
NameQueryRequest[nameTrnId=2,isResponse=false,opCode=QUERY,isAuthAnswer=false,is
Truncated=false,isRecurAvailable=false,isRecurDesired=true,isBroadcast=true,resu
ltCode=0,questionCount=1,answerCount=0,authorityCount=0,additionalCount=0,questi
onName=..__MSBROWSE__.<01>,questionType=0x0020,questionClass=IN,recordName=null,
recordType=0x0000,recordClass=0x0000,ttl=0,rDataLength=0]
Mar 15 20:47:59.051 - datagram packet sent to: 255.255.255.255
00000: 00 02 01 10 00 01 00 00 00 00 00 00 20 41 42 41  |............ ABA|
00010: 43 46 50 46 50 45 4E 46 44 45 43 46 43 45 50 46  |CFPFPENFDECFCEPF|
00020: 48 46 44 45 46 46 50 46 50 41 43 41 42 00 00 20  |HFDEFFPFPACAB.. |
00030: 00 01                                            |..              |

Mar 15 20:48:02.055 - nbt name service packet sent
NameQueryRequest[nameTrnId=3,isResponse=false,opCode=QUERY,isAuthAnswer=false,is
Truncated=false,isRecurAvailable=false,isRecurDesired=true,isBroadcast=true,resu
ltCode=0,questionCount=1,answerCount=0,authorityCount=0,additionalCount=0,questi
onName=..__MSBROWSE__.<01>,questionType=0x0020,questionClass=IN,recordName=null,
recordType=0x0000,recordClass=0x0000,ttl=0,rDataLength=0]
Mar 15 20:48:02.055 - datagram packet sent to: 255.255.255.255
00000: 00 03 01 10 00 01 00 00 00 00 00 00 20 41 42 41  |............ ABA|
00010: 43 46 50 46 50 45 4E 46 44 45 43 46 43 45 50 46  |CFPFPENFDECFCEPF|
00020: 48 46 44 45 46 46 50 46 50 41 43 41 42 00 00 20  |HFDEFFPFPACAB.. |
00030: 00 01                                            |..              |

Mar 15 20:48:05.060 - name service address cache
 0.0.0.0<00> 0.0.0.0<00>/0.0.0.0
 ..__MSBROWSE__.<01> 0.0.0.0<00>/0.0.0.0
 JCIFS0_8_FB<20> JCIFS0_8_FB<20>/192.168.0.8

Exception in thread "main" java.net.UnknownHostException: ..__MSBROWSE__.<01>
        at jcifs.netbios.NbtAddress.doNameQuery(NbtAddress.java:319)
        at jcifs.netbios.NbtAddress.getByName(NbtAddress.java:390)
        at jcifs.netbios.NbtAddress.getByName(NbtAddress.java:371)
        at jcifs.smb.SmbFile.<init>(SmbFile.java:385)
        at jcifs.smb.SmbFile.<init>(SmbFile.java:335)
        at SmbShell.run(SmbShell.java:76)
        at SmbShell.main(SmbShell.java:183)

O:\jcifs_0.6.1\examples>

>>> Christopher R. Hertel <crh at ubiqx.mn.org> 03/15/02 06:40PM >>>
On Thu, Mar 14, 2002 at 10:47:14PM -0500, Tony Thompson wrote:
> Mike,
> 
> OK, maybe it is just me but, I am running on a Win2k machine.

I'm terribly afraid that it's not just you.  If it were, we wouldn't need
to write things like jCIFS.

;)

>  I have Active Directory installed.  It is the only Windoze machine
>  running on my network.  I have WINS installed and I have tried
> configuring jcifs to use WINS with no luck either.  When I try running
> the SmbShell with log=ALL, this is what I get:
>
> O:\jcifs_0.6.1\examples>java -Dlog=ALL -cp ..\jcifs-0.6.1.jar;. SmbShell
> #properties loaded
> #Thu Mar 14 22:30:10 EST 2002
> log=ALL
> java.version=1.3.1_02
> java.home=C:\\Program Files\\JavaSoft\\JRE\\1.3.1_02
> java.ext.dirs=C:\\Program Files\\JavaSoft\\JRE\\1.3.1_02\\lib\\ext
> java.vm.version=1.3.1_02-b02
> java.vm.name=Java HotSpot(TM) Client VM
> java.vm.info=mixed mode
> java.vm.vendor=Sun Microsystems Inc.
> java.vm.specification.version=1.0
> java.vm.specification.name=Java Virtual Machine Specification
> java.vm.specification.vendor=Sun Microsystems Inc.
> java.class.version=47.0
> java.class.path=..\\jcifs-0.6.1.jar;.
> java.runtime.version=1.3.1_02-b02
> java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
> java.specification.version=1.3
> java.specification.name=Java Platform API Specification
> java.specification.vendor=Sun Microsystems Inc.
> java.io.tmpdir=c:\\temp\\
> java.awt.printerjob=sun.awt.windows.WPrinterJob
> java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
> java.awt.fonts=
> java.library.path=C:\\WINNT\\system32;.;C:\\WINNT\\System32;C:\\WINNT;C:\\WINNT\
> \system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;C:\\WINNT\\system32\\nls;C:\\WINNT
> \\system32\\nls\\English;Z:.;
> java.vendor.url=http://java.sun.com/ 
> java.protocol.handler.pkgs=jcifs
> file.separator=\\
> file.encoding.pkg=sun.io
> os.version=5.0
> os.name=Windows 2000
> os.arch=x86
> user.name=Administrator
> user.dir=O:\\jcifs_0.6.1\\examples
> user.timezone=America/Indianapolis
> user.region=US
> user.home=C:\\Documents and Settings\\Administrator.002
> user.language=en
> sun.boot.library.path=C:\\Program Files\\JavaSoft\\JRE\\1.3.1_02\\bin
> sun.boot.class.path=C:\\Program Files\\JavaSoft\\JRE\\1.3.1_02\\lib\\rt.jar;C:\\
> Program Files\\JavaSoft\\JRE\\1.3.1_02\\lib\\i18n.jar;C:\\Program Files\\JavaSof
> t\\JRE\\1.3.1_022DataLength=0]
Mar 15 20:48:02\\lib\\sunrsasign.jar;C:\\Program Files\\JavaSoft\\JRE\\1.3.1_02
> \\classes
> sun.cpu.endian=little
> sun.cpu.isalist=pentium i486 i386
> sun.io.unicode.encoding=UnicodeLittle
> awt.toolkit=sun.awt.windows.WToolkit
> path.separator=;
> line.separator=\r\n
> 
> Mar 14 22:30:11.799 - name service address cache
>  0.0.0.0<00> 0.0.0.0<00>/0.0.0.0
>  JCIFS0_8_4B<20> JCIFS0_8_4B<20>/192.168.0.8
> 
> Mar 14 22:30:11.809 - nbt name service packet sent
> NameQueryRequest[nameTrnId=1,isResponse=false,opCode=QUERY,isAuthAnswer=false,is
> Truncated=false,isRecurAvailable=false,isRecurDesired=true,isBroadcast=true,resu
> ltCode=0,questionCount=1,answerCount=0,authorityCount=0,additionalCount=0,questi
> onName=..__MSBROWSE__.<01>,questionType=0x0020,questionClass=IN,recordName=null,
> recordType=0x0000,recordClass=0x0000,ttl=0,rDataLength=0]
> Mar 14 22:30:11.819 - datagram packet sent to: 255.255.255.255
> 00000: 00 01 01 10 00 01 00 00 00 00 00 00 20 41 42 41  |............ ABA|
> 00010: 43 46 50 46 50 45 4E 46 44 45 43 46 43 45 50 46  |CFPFPENFDECFCEPF|
> 00020: 48 46 44 45 46 46 50 46 50 41 43 41 42 00 00 20  |HFDEFFPFPACAB.. |
> 00030: 00 01                                            |..              |

This is a broadcast query being sent to the local subnet, not to the WINS
server.  It is looking for the local browser.  Any browser will do (any
workgroup, local master or backup... we don't care, we just want to find 
someone with a browse list).  The message is repeated once.

[Mike:  I'm missing something.  The second attempt has a TrnID of 2, not 1
        like the first.  Shouldn't there be three tries, all with the same
        TrnID?]

> Mar 14 22:30:14.823 - nbt name service packet sent
> NameQueryRequest[nameTrnId=2,isResponse=false,opCode=QUERY,isAuthAnswer=false,is
> Truncated=false,isRecurAvailable=false,isRecurDesired=true,isBroadcast=true,resu
> ltCode=0,questionCount=1,answerCount=0,authorityCount=0,additionalCount=0,questi
> onName=..__MSBROWSE__.<01>,questionType=0x0020,questionClass=IN,recordName=null,
> recordType=0x0000,recordClass=0x0000,ttl=0,rDataLength=0]
> Mar 14 22:30:14.823 - datagram packet sent to: 255.255.255.255
> 00000: 00 02 01 10 00 01 00 00 00 00 00 00 20 41 42 41  |............ ABA|
> 00010: 43 46 50 46 50 45 4E 46 44 45 43 46 43 45 50 46  |CFPFPENFDECFCEPF|
> 00020: 48 46 44 45 46 46 50 46 50 41 43 41 42 00 00 20  |HFDEFFPFPACAB.. |
> 00030: 00 01                                            |..              |
> 
> Mar 14 22:30:17.828 - name service address cache
>  0.0.0.0<00> 0.0.0.0<00>/0.0.0.0
>  JCIFS0_8_4B<20> JCIFS0_8_4B<20>/192.168.0.8
>  ..__MSBROWSE__.<01> 0.0.0.0<00>/0.0.0.0
> 
> Exception in thread "main" java.net.UnknownHostException: ..__MSBROWSE__.<01>
>         at jcifs.netbios.NbtAddress.doNameQuery(NbtAddress.java:319)
>         at jcifs.netbios.NbtAddress.getByName(NbtAddress.java:390)
>         at jcifs.netbios.NbtAddress.getByName(NbtAddress.java:371)
>         at jcifs.smb.SmbFile.<init>(SmbFile.java:385)
>         at jcifs.smb.SmbFile.<init>(SmbFile.java:335)
>         at SmbShell.run(SmbShell.java:75)
>         at SmbShell.main(SmbShell.java:181)
> 
> O:\jcifs_0.6.1\examples>

The above says that jCIFS was not able to fine a browse server on the
local subnet.

> I am able to get SmbShell to work if I specify my host in the URL
> (smb://192.168.0.8).  Can anyone tell if this is just a dumb user
> problem or if there is something wrong with jcifs?

To understand what's going on here, you need some idea of how Microsoft's
browse service works, and then you'll want to dig into the workings of the
SMB URL.  Start with the first.  See:1_022DataLength=0]
Mar 15 20:48:02

  http://www.linux-mag.com/2001-05/smb_01.html 

There's information in there about how the browse service works.

The key bit regarding SmbShell is that it tries, at startup, to begin at
the top of the SMB URL hierarchy.  That would be the browse list.  To do
that, it needs to find a browse server.  There is no browse server on your
LAN, according to the output above.

Good luck!  :)

Chris -)-----

-- 
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org 
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org




More information about the jcifs mailing list