[jcifs] New user questions

Tony Thompson tony.thompson at stone-ware.com
Fri Mar 15 14:47:14 EST 2002


Mike,

OK, maybe it is just me but, I am running on a Win2k machine.  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_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                                            |..              |

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>

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?

Thanks for any help.
Tony

>>> "Allen, Michael B (RSCH)" <Michael_B_Allen at ml.com> 03/13/02 09:26PM >>>


> -----Original Message-----
> From:	Tony Thompson [SMTP:tony.thompson at stone-ware.com] 
> Sent:	Wednesday, March 13, 2002 5:40 PM
> To:	jcifs at lists.samba.org 
> Subject:	[jcifs] New user questions
> 
> Hello,
> 
> I am attempting to run the example SmbShell provided with the distribution and just about anything I have tried results in an UnknownHostException.  The FAQ talks about this exception but, I don't
> know how to specify the host when I am using SmbShell.  Any pointers?
> 
	If you can't even start it then you don't have a master browser which is admittedly a
	problem but the SmbShell is just a demo. Otherwise just type the name:

	smb://> cd myservername
	myservername> ls
	ect...

	Otherwise look closer at the FAQ.

> The other issue that I have is the way SmbFile works.  It appears that I can only have one SmbFile instance hanging around in a JVM because of the way authentication is handled (it uses a static
> AuthHandler).  I need to be able to create several connections to a CIFS server with potentially different users authenticated on each connection all within the same JVM instance.  Is there a way to
> do this?
> 
	Just do it. Look at how athentication is passed in the URL and take appropriate
	action based on what username is passed to your AuthHandler. You also do not
	need to use AuthHandler at all. In fact you probably don't for backend type work.

> Once I have a connection, I will be performing several operations via the same connection (don't authenticate each time) and then disconnecting the connection.  Is there a way to keep a session
> connected and then disconnect it when I am done?  I couldn't find a way to disconnect a session.
> 
	The public interface to jCIFS does not provide the concept of a "connection". That is
	not necessary. The client will multiplex IO in an optimal way.

	Mike





More information about the jcifs mailing list