[jcifs] JCIFS error
Allen, Michael B (RSCH)
Michael_B_Allen at ml.com
Mon Jul 22 11:14:55 EST 2002
> -----Original Message-----
> From: Benjamin Farr [SMTP:Benjamin.Farr at mim.com.au]
>
>
> try {
>
> /*
> if( f.exists()) {
[Allen, Michael B (RSCH)]
If you test f.exists(), that will result in an additional network message. If you want to delete the file just call try { f.delete() } catch( SmbException se ) { // do nothing }.
> // should delete it ????
> } else {
>
> } */
> }catch(Exception e){
> throw new MimException(e);
> }
> try {
>
> System.setProperty( "jcifs.smb.client.username", "meo" );
> System.setProperty( "jcifs.smb.client.password", "meo123" );
> System.setProperty( "jcifs.smb.client.domain", "mimh" );
> System.setProperty( "jcifs.smb.client.responseTimeout", "50000" );
> System.setProperty( "jcifs.smb.client.soTimeout", "50000" );
> System.setProperty( "jcifs.netbios.soTimeout", "15000" );
>
[Allen, Michael B (RSCH)] You cannot set properties like this. Read the
javadoc page on Setting Client Properties. In short you cannot set properties after
you have referenced Smb* classes. It would be best if you used a properties file and
specified it's location *before* referencing any jcifs classes like:
System.setProperty( "jcifs.properties", "myjcifs.prp" );
SmbFile f = new SmbF...
Technically the above might work but not always so the general rule is don't do it. As for
the Exception, that might mean jCIFS is incompatible with the server. What type of server
is it? Is it NetApp? Novell? Jim's Smb Server 2.0?
Also, you shouldn't have to mess with responseTimeout or soTimeout. If it takes longer
than 2 seconds for the client to do it's thing there's something wrong.
Fix that and let us know if the problem persists.
Mike
More information about the jcifs
mailing list