[jcifs] Problem with JCIFS 1.3.14 - Incorrect function

jujojujo hopsas at gmail.com
Mon May 17 05:34:05 MDT 2010


Hello - I`ve encounter a strange problem with JCIFS version 1.2.25 / 1.3.14
(both version checked for problem).

In the middle of downloading a file from a remote server (Win2003 machine),
sometimes (well, almost always) a strange exception appears:

Connecting to address:
smb://xxx.xxx.xxx.xxx/ArchivedRecordings/tenant4/Archive 
10-01-26/xxx/10-01-19/
Listing some files found:
smbFile.getName() = tenant4_0004_119 08-20-51.wav
smbFile.getName() = tenant4_0004_120 12-14-56.wav
smbFile.getName() = tenant4_0004_121 16-52-53.wav
...
Trying to download single file: tenant4_0004_135 12-58-00.wav, size:
13010593
bytesRead = 524288
bytesRead = 524288
bytesRead = 524288
bytesRead = 524288
bytesRead = 524288
bytesRead = 524288
bytesRead = 524288
bytesRead = 524288
</system-out>
    <system-err>doFindFirstNext: \tenant4\Archive 10-01-26\xxx\10-01-19\
...........
java.net.UnknownHostException: sample.domain
    at jcifs.UniAddress.getAllByName(UniAddress.java:315)
    at jcifs.UniAddress.getByName(UniAddress.java:245)
    at jcifs.smb.Dfs.getTrustedDomains(Dfs.java:62)
    at jcifs.smb.Dfs.resolve(Dfs.java:167)
....
jcifs.smb.SmbException: Incorrect function.
    at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:545)
    at jcifs.smb.SmbTransport.send(SmbTransport.java:645)
    at jcifs.smb.SmbSession.send(SmbSession.java:244)
    at jcifs.smb.SmbTree.send(SmbTree.java:119)
    at jcifs.smb.SmbFile.send(SmbFile.java:770)
....

What bothers me is the fact, that the exception above behaves completely
unpredictable: sometimes it happens after downloading 0,5 Mb of data,
sometimes after 7 Mb and so on...

Does any of You encountered this kind of strange behavior ?

Of course, I try to download a file using standard procedure:

NtlmPasswordAuthentication ntlm = return new
NtlmPasswordAuthentication("sample_domain", "username", "password");
String addr = "smb://xxx.xxx.xxx.xxx/ArchivedRecordings/tenant4/Archive 
10-01-26/xxx/10-01-19/tenant4_0004_135 12-58-00.wav"
SmbFileInputStream sfis = new SmbFileInputStream(new SmbFile(addr, ntlm));

... of course ip addr , domain name, user and password are correctly set
(not xxx :))
 byte[] byteArray = new byte[64536];
                while (true) {
                    int bytesRead = sfis.read(byteArray);
                    if (bytesRead == -1) break;
                    else fos.write(byteArray, 0, bytesRead);
                }

Regards,
jujojujo
-- 
View this message in context: http://old.nabble.com/Problem-with-JCIFS-1.3.14---Incorrect-function-tp28582090p28582090.html
Sent from the Samba - jcifs mailing list archive at Nabble.com.



More information about the jCIFS mailing list