[jcifs] question on fixes in 1.1.6

Michael B Allen mba2000 at ioplex.com
Thu Dec 30 22:52:38 GMT 2004


Please send all correspondance to the jcifs mailing list.

roy-jcifs at xemaps.com said:
> Hey Michael,
>
> Was it clear that the last exceptions I posted were from my machine
> copying
> files back and forth to itself?

That rules out a network problem.

>  If it wasn't sorry!  I would not have
> thought
> that this process would be a problem running locally (ie remote and local
> are
> the same machine).  It shouldn't even involve my office network (100meg
> full-duplex 3com) if its running locally, right?

It shouldn't matter but this is a very important bit of information.
Copying things over loopback is much much quicker and may be better at
exposing concurrency flaws.

> The interesting thing is that on our production network the original
> exceptions I sent only occur when our program is dealing with a situation
> of
> moving thousands of files.
>
> Our process of copying remote files to a local machine is very simple.
>
> for every file...
> // get remote file
> SmbFile remote = new SmbFile(
> "smb://domain;user:pass@machine/share/dir/dir/dir/file" );

Well I just ran the following test program:

$ cat TestCopy.java
import jcifs.smb.*;

public class TestCopy {

    public static void main( String[] args ) throws Exception {
        for( int i = 0; i < args.length; i += 2 ) {
            try {
                SmbFile remote = new SmbFile( args[i] );
                if( remote.exists() ) {
                    SmbFile local = new SmbFile( args[i + 1] );
                    remote.copyTo( local );
                }
            } catch( Exception e ) {
                System.err.println( args[i] + " -> " + args[i + 1] );
                e.printStackTrace();
            }
        }
    }
}

and ran it over loopback with a script like:

$ cat tc.sh
#!/bin/sh

java -Djcifs.properties=../miallen.prp TestCopy smb://miallen/miallen/bin/
smb://miallen/tmp/TestCopy/bin/ smb://miallen/miallen/Desktop/
smb://miallen/tmp/TestCopy/ ... about 10 other path pairs

I copied 500 MB of directories and received two errors. One was Access
Denied because some files within the directory being copied were owned by
root and the other was "The filename, directory name, or volume label
syntax is incorrect." which occured because of some crazy pathnames that
Samba didn't understand.

So basically it worked flawlessly for me. Can you modify this test program
to try copying your list of thousands of files? If so, does it work for
you?

>> Wha? First, why would you kill the thread? The response timeout
>> limit is 10 seconds. If copyTo talks longer than that then that
>
> I have one dedicated thread that copies files from a remote machine to a
> local
> machine via jcifs.  The NullPointerException gets thrown by some jcifs
> Thread
> started in SmbTransport run method.  The result is that my thread sits
> there
> waiting for the copyTo to return.  Sorry it wasn't clear.  Anyway, not
> certain
> if this error is occuring anymore with 1.1.5 or 1.1.6.  Will get back to
> you
> if you're not tired of me already :)

That's ok. Just try to isolate the problem more. There's not much I can do
if you can't reproduce the problem. Make sure you're using the right jar
and try to isolate where it craps out. Put a try catch *inside* your loop
so you can print the offending file. Etc.

Mike


More information about the jcifs mailing list