[jcifs] WINS setting being ignored

Michael Kerley michael at enkoo.com
Fri Jun 18 01:39:04 GMT 2004


Michael B Allen wrote:
> Michael Kerley said:
> 
>>I'm having trouble getting the WINS setting to work in jCIFS.  I set the
> 
> <snip>
> 
>>Is there something that would cause jCIFS to ignore the WINS setting?
> 
> 
> Yes. User error :)

I *think* I'm doing it right, but maybe you can see something I did wrong.

Here is the test program (a modified copy of the List.java example 
program with my custom settings added):

-----------------------------------------------------------------------
import jcifs.Config;
import jcifs.util.Log;
import jcifs.smb.SmbFile;

public class List {

     public static void main( String[] argv ) throws Exception {
         // My custom settings
         Log.addMask(Log.ALL);
         Config.setProperty("jcifs.netbios.wins", "172.16.14.250");
         Config.setProperty("jcifs.netbios.baddr", "192.168.100.255");
         Config.setProperty("jcifs.resolveOrder", "WINS");
         System.out.println("WINS server: " +
             Config.getProperty( "jcifs.netbios.wins"));
         System.out.println("Broadcast: " +
             Config.getProperty( "jcifs.netbios.baddr"));
         System.out.println("Resolve order: " +
             Config.getProperty( "jcifs.resolveOrder"));

         // The rest is the standard jCFIS "List.java" example
         SmbFile file = new SmbFile( argv[0] );

         long t1 = System.currentTimeMillis();
         String[] files = file.list();
         long t2 = System.currentTimeMillis() - t1;

         for( int i = 0; i < files.length; i++ ) {
             System.out.print( " " + files[i] );
         }
         System.out.println();
         System.out.println( files.length + " files in " + t2 + "ms" );
     }
}
-----------------------------------------------------------------------

And here is the output from that program:

-----------------------------------------------------------------------
$ java List smb://
#properties loaded
#Fri Jun 18 05:37:20 EDT 2004
line.separator=\n
user.name=root
user.dir=/root/jcifs_0.7.19/examples
user.timezone=America/New_York
user.home=/root
user.country=US
user.language=en
file.separator=/
file.encoding.pkg=sun.io
sun.boot.library.path=/usr/java/j2sdk1.4.2_03/jre/lib/i386
sun.boot.class.path=/usr/java/j2sdk1.4.2_03/jre/lib/rt.jar:/usr/java/j2sdk1.4.2_03/jre/lib/i18n.jar:/usr/java/j2sdk1.4.2_03/jre/lib/sunrsasign.jar:/usr/java/j2sdk1.4.2_03/jre/l 
 
ib/jsse.jar:/usr/java/j2sdk1.4.2_03/jre/lib/jce.jar:/usr/java/j2sdk1.4.2_03/jre/lib/charsets.jar:/usr/java/j2sdk1.4.2_03/jre/classes
sun.arch.data.model=32
sun.cpu.endian=little
sun.cpu.isalist=
sun.os.patch.level=unknown
sun.io.unicode.encoding=UnicodeLittle
sun.java2d.fontpath=
java.version=1.4.2_03
java.home=/usr/java/j2sdk1.4.2_03/jre
java.ext.dirs=/usr/java/j2sdk1.4.2_03/jre/lib/ext
java.vm.version=1.4.2_03-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.endorsed.dirs=/usr/java/j2sdk1.4.2_03/jre/lib/endorsed
java.class.version=48.0
java.class.path=.:/root/jcifs_0.7.19/jcifs-0.7.19.jar
java.runtime.version=1.4.2_03-b02
java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
java.specification.version=1.4
java.specification.name=Java Platform API Specification
java.specification.vendor=Sun Microsystems Inc.
java.util.prefs.PreferencesFactory=java.util.prefs.FileSystemPreferencesFactory
java.io.tmpdir=/tmp
java.awt.printerjob=sun.print.PSPrinterJob
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
java.library.path=/usr/java/j2sdk1.4.2_03/jre/lib/i386/client:/usr/java/j2sdk1.4.2_03/jre/lib/i386:/usr/java/j2sdk1.4.2_03/jre/../lib/i386
java.vendor.url=http://java.sun.com/
os.version=2.4.20-8
os.name=Linux
os.arch=i386
path.separator=:

WINS server: 172.16.14.250
Broadcast: 192.168.100.255
Resolve order: WINS
Jun 18 05:37:20.404 - name service address cache
  JCIFS0_1_1B<00> JCIFS0_1_1B<00>/127.0.0.1
  0.0.0.0<00> 0.0.0.0<00>/0.0.0.0

Jun 18 05:37:20.417 - nbt name service packet sent
NameQueryRequest[nameTrnId=1,isResponse=false,opCode=QUERY,isAuthAnswer=false,isTruncated=false,isRecurAvailable=false,isRecurDesired=true,isBroadcast=true,resultCode=0,questio 
 
nCount=1,answerCount=0,authorityCount=0,additionalCount=0,questionName=..__MSBROWSE__.<01>,questionType=0x0020,questionClass=IN,recordName=null,recordType=0x0000,recordClass=0x 
 
0000,ttl=0,rDataLength=0]
Jun 18 05:37:20.418 - datagram packet sent to: 192.168.100.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                                            |..              |

Jun 18 05:37:23.428 - name service address cache
  JCIFS0_1_1B<00> JCIFS0_1_1B<00>/127.0.0.1
  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

Exception in thread "main" jcifs.smb.SmbException: Unknown host: 
..__MSBROWSE__.<01>
         at jcifs.smb.SmbFile.connect0(SmbFile.java:552)
         at jcifs.smb.SmbFile.list(SmbFile.java:1149)
         at List.main(List.java:24)
-----------------------------------------------------------------------

Any thoughts?

Thanks
Michael


More information about the jcifs mailing list