[jcifs] Question about configuring resolve order

mike mike at opennms.org
Thu Mar 14 10:23:51 EST 2002


Hello,

I'm attempting to use NbtAddress.getByName() to resolve IP
addresses to their corresponding NetBIOS name.  Provided that the
IP address resides on the same subnet this appears to
work.  However when the box resides on a different
subnet I get an UnknownHostException.

The 'jcifs.netbios.wins' and 'jcifs.resolveOrder' properties
appear to be set correctly.


I turned on debugging and here's what I'm seeing:

---------------------------------------------------------------------------
...
jcifs.resolveOrder=WINS,BCAST
jcifs.properties=./jcifs.properties
jcifs.smb.client.password=
jcifs.smb.client.domain=
jcifs.smb.client.laddr=
jcifs.smb.client.username=guest
jcifs.util.log=ALL
jcifs.netbios.retryTimeout=2000
jcifs.netbios.cachePolicy=30
jcifs.netbios.baddr=255.255.255.255
jcifs.netbios.retryCount=2
jcifs.netbios.wins=192.168.0.38
jcifs.netbios..hostname=OpenNMS_DP
path.separator=:

Mar 13 18:05:38.304 - name service address cache
   0.0.0.0<00> 0.0.0.0<00>/0.0.0.0
   JCIFS0_198_CC<20> JCIFS0_198_CC<20>/192.168.0.198

Mar 13 18:05:38.331 - nbt name service packet sent
NodeStatusRequest[nameTrnId=1,isResponse=false,opCode=QUERY,isAuthAnswer=false,isTruncated=false,isRecurAvailable=false,isRecurDesired=true,isBroadcast=true,resultCode=0,questionCount=1,answerCount=0,authorityCount=0,additionalCount=0,questionName=*<00>,questionType=0x0021,questionClass=IN,recordName=null,recordType=0x0000,recordClass=0x0000,ttl=0,rDataLength=0]
Mar 13 18:05:38.332 - datagram packet sent to: 192.168.3.2
00000: 00 01 01 10 00 01 00 00 00 00 00 00 20 43 4B 41  |............ CKA|
00010: 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41  |AAAAAAAAAAAAAAAA|
00020: 41 41 41 41 41 41 41 41 41 41 41 41 41 00 00 21  |AAAAAAAAAAAAA..!|
00030: 00 01                                            |..              |

Mar 13 18:05:42.349 - nbt name service packet sent
NodeStatusRequest[nameTrnId=3,isResponse=false,opCode=QUERY,isAuthAnswer=false,isTruncated=false,isRecurAvailable=false,isRecurDesired=true,isBroadcast=true,resultCode=0,questionCount=1,answerCount=0,authorityCount=0,additionalCount=0,questionName=*<00>,questionType=0x0021,questionClass=IN,recordName=null,recordType=0x0000,recordClass=0x0000,ttl=0,rDataLength=0]
Mar 13 18:05:42.350 - datagram packet sent to: 192.168.3.2
00000: 00 03 01 10 00 01 00 00 00 00 00 00 20 43 4B 41  |............ CKA|
00010: 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41  |AAAAAAAAAAAAAAAA|
00020: 41 41 41 41 41 41 41 41 41 41 41 41 41 00 00 21  |AAAAAAAAAAAAA..!|
00030: 00 01                                            |..              |

Mar 13 18:05:44.361 - nbt name service packet sent
NodeStatusRequest[nameTrnId=4,isResponse=false,opCode=QUERY,isAuthAnswer=false,isTruncated=false,isRecurAvailable=false,isRecurDesired=true,isBroadcast=true,resultCode=0,questionCount=1,answerCount=0,authorityCount=0,additionalCount=0,questionName=*<00>,questionType=0x0021,questionClass=IN,recordName=null,recordType=0x0000,recordClass=0x0000,ttl=0,rDataLength=0]
Mar 13 18:05:44.362 - datagram packet sent to: 192.168.3.2
00000: 00 04 01 10 00 01 00 00 00 00 00 00 20 43 4B 41  |............ CKA|
00010: 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41  |AAAAAAAAAAAAAAAA|
00020: 41 41 41 41 41 41 41 41 41 41 41 41 41 00 00 21  |AAAAAAAAAAAAA..!|
00030: 00 01                                            |..              |

Mar 13 18:05:48.378 - nbt name service packet sent
NodeStatusRequest[nameTrnId=6,isResponse=false,opCode=QUERY,isAuthAnswer=false,isTruncated=false,isRecurAvailable=false,isRecurDesired=true,isBroadcast=true,resultCode=0,questionCount=1,answerCount=0,authorityCount=0,additionalCount=0,questionName=*<00>,questionType=0x0021,questionClass=IN,recordName=null,recordType=0x0000,recordClass=0x0000,ttl=0,rDataLength=0]
Mar 13 18:05:48.379 - datagram packet sent to: 192.168.3.2
00000: 00 06 01 10 00 01 00 00 00 00 00 00 20 43 4B 41  |............ CKA|
00010: 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41  |AAAAAAAAAAAAAAAA|
00020: 41 41 41 41 41 41 41 41 41 41 41 41 41 00 00 21  |AAAAAAAAAAAAA..!|
00030: 00 01                                            |..              |

Exception in thread "main" java.net.UnknownHostException: no name with
type 0x00 with no scope for host 192.168.3.2
          at jcifs.netbios.NbtAddress.getAllByAddress(NbtAddress.java:495)
          at jcifs.netbios.NbtAddress.checkData(NbtAddress.java:634)
          at jcifs.netbios.NbtAddress.getNodeType(NbtAddress.java:665)
          at Query.main(Query.java:30)
-------------------------------------------------------------------------

I don't understand why all the requests are being sent directly to
the 192.168.3.2 address.  My understanding is that based on my
properties settings I should see requests first being sent to the
WINS server and if that fails requests would next be broadcasted
on the local subnet.  What am I missing?

Thanks in advance.

Mike






More information about the jcifs mailing list