[jcifs] Problem in jcifs-1.2.25 with DFS
liuqiang at rst.ricoh.com
liuqiang at rst.ricoh.com
Thu Oct 23 02:14:12 GMT 2008
Good morning!
Sorry to bother you!
I am sorry that I do not know a formal way to post JCIFS problems I hav
found recently.
If possible,Could you please tell me a formal way to send following
message to your JCIFS members?
Now,I want to report two problems in latest JCIFS-1.2.25 source codes.
# I used your sample file(AuthListFiles.java) to do List File Test from
downloaded JCIFS-1.2.25 zip file.
Problem1 : When the specified URL is like this form
"smb://DomainName/DFSRoot/" and do list file
operation under this URL,JCIFS will throw the following
exception and failed to list files.
But when I use Windows Explorer to access the above URL,it
is successful to do list file operation.
Exception Contents:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException:
String index out of range: -26
at java.lang.String.substring(String.java:1762)
at java.lang.String.substring(String.java:1735)
at jcifs.smb.SmbFile.resolveDfs(SmbFile.java:689)
at jcifs.smb.SmbFile.send(SmbFile.java:719)
at jcifs.smb.SmbFile.doFindFirstNext(SmbFile.java:1923)
at jcifs.smb.SmbFile.doEnum(SmbFile.java:1675)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1652)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1585)
at AuthListFiles.<init>(AuthListFiles.java:35)
at AuthListFiles.main(AuthListFiles.java:76)
After my investigation,Error Place is shown as following.
In SmbFile.java
void resolveDfs(ServerMessageBlock request) throws
SmbException {
............
//Because the dr.pathConsumed is negative,it
caused the above StringIndexOutOfBoundsException
String dunc = unc.substring(dr.pathConsumed);
............
}
============================================================
The assignment for the dr.pathConsumed is "dr.pathConsumed
-= 1 + domain.length() + 1 + root.length();"
I am sorry that I can not understand why do it like that.
Could you also do a little explaination for this following
source code in JCIFS-1.2.25?
dr.pathConsumed -= 1 + domain.length() + 1 + root.length();
And if possible, Could you tell me what is "path consumed"(I
can see it in SMB package)
corresponding to the parameter("pathConsumed")?
Problem2 : When the specified URL is like this form
"smb://DomainName/DFSRoot/FileServer1ShareName"
and do list file operation under this URL,JCIFS will throw
the following exception and
failed to list files.
But I can also use Windows Explorer to access the above URL
and successfully do List File operation.
Exception Contents:
Exception in thread "main" jcifs.smb.SmbException: The
network name cannot be found.
at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:527)
at jcifs.smb.SmbTransport.send(SmbTransport.java:629)
at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:288)
at jcifs.smb.SmbSession.send(SmbSession.java:233)
at jcifs.smb.SmbTree.treeConnect(SmbTree.java:161)
at jcifs.smb.SmbTree.send(SmbTree.java:66)
at jcifs.smb.SmbFile.send(SmbFile.java:721)
at jcifs.smb.SmbFile.doFindFirstNext(SmbFile.java:1923)
at jcifs.smb.SmbFile.doEnum(SmbFile.java:1675)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1652)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1585)
at AuthListFiles.<init>(AuthListFiles.java:35)
at AuthListFiles.main(AuthListFiles.java:75)
The following is its final packet information. Could you tell
me when SMB server will reponse the
following kind of error("Tid invalid")?
(Embedded image moved to file: pic29168.jpg)
(Embedded image moved to file: pic00900.jpg)
I am sorry to ask so much questions! :(
Thank you very much!
Best Regards!
Dannies
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic29168.jpg
Type: image/jpeg
Size: 6679 bytes
Desc: not available
Url : http://lists.samba.org/archive/jcifs/attachments/20081023/d0199221/pic29168-0001.jpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic00900.jpg
Type: image/jpeg
Size: 27551 bytes
Desc: not available
Url : http://lists.samba.org/archive/jcifs/attachments/20081023/d0199221/pic00900-0001.jpg
More information about the jcifs
mailing list