[jcifs] JCIFS error

Benjamin Farr Benjamin.Farr at mim.com.au
Mon Jul 22 12:27:36 EST 2002


I setup a properties file and that is working fine. I removed the timeout

I believe the server is Novell.

The file does get created on the server but has an exception with

This is the exeption output of checking for f.exists();

S : Timeout waiting for response from server.
dev.holdings.mim.com.au/ Jul 22 12:19:10.211 - exception
reading from socket input java.net.SocketException: Descriptor not a socket:
JVM_recv in socket input stream read 	int
java.net.SocketInputStream.socketRead(byte[], int, int) 	int
java.net.SocketInputStream.read(byte[], int, int) 	int
byte[], int) 	int jcifs.netbios.SocketInputStream.read(byte[], int, int)
int jcifs.netbios.SocketInputStream.read() 	int
java.io.FilterInputStream.read() 	int
java.io.PushbackInputStream.read() 	void jcifs.smb.SmbTransport.run()
void java.lang.Thread.run() jcifs.smb.SmbException: Timeout waiting for
response from server. dev.holdings.mim.com.au/ 	void
jcifs.smb.SmbComTransactionResponse) 	void
jcifs.smb.SmbComTransactionResponse) 	void
jcifs.smb.SmbComTransactionResponse) 	void
jcifs.smb.SmbComTransactionResponse) 	jcifs.smb.Info
jcifs.smb.SmbFile.queryPath(int) 	boolean jcifs.smb.SmbFile.exists()
void com.mim.mimsj.hr.HREmpPhotos.createFile(java.io.InputStream,
java.lang.String, java.lang.String, java.lang.String, java.lang.String,
java.lang.String) 	java.lang.String
t) 	void _HREmpPhoto3._jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) 	void
javax.servlet.ServletResponse) 	void
est, javax.servlet.http.HttpServletResponse, java.lang.String) 	void
etRequest, javax.servlet.http.HttpServletResponse) 	void
t, javax.servlet.http.HttpServletResponse) 	void
javax.servlet.ServletResponse) 	void
etRequest, javax.servlet.ServletResponse) 	void
let.ServletRequest, javax.servlet.http.HttpServletResponse) 	boolean
com.evermind.server.http.EvermindHttpServletResponse, java.io.InputStream,
java.io.OutputStream, boolean) 	void
com.evermind.server.http.HttpRequestHandler.run(java.lang.Thread) 	void

// Function 
public static void createFile(InputStream aSrc,String aHost,String
aUserName,String aPassword,String aPath,String aFilename) throws
    SmbFileOutputStream smbOut = null;

    try { 
      SmbFile f = new SmbFile("smb://"+aUserName+":" + aPassword +
"@"+aHost+aPath+ "/" +aFilename);
      smbOut = new  SmbFileOutputStream(f);
       try {
          if( f.exists()) { 
          else {
         catch(Exception e){
           System.out.println("S : " + e.getMessage());
           throw new MimException(e);
      byte[] b = new byte[1024];
      int n;
      while(( n = aSrc.read( b )) > 0 ) {    
         System.out.println(n + " bytes read this time");
         try {
              smbOut.write(b, 0, n );
         catch (Exception e) {
            System.out.println("A : " + e.getMessage());
    catch(Exception e) {
      throw new MimException(e);

-----Original Message-----
From: Allen, Michael B (RSCH) [mailto:Michael_B_Allen at ml.com]
Sent: Monday, 22 July 2002 11:15
To: 'Benjamin Farr'; 'jcifs at samba.org'
Subject: RE: [jcifs] JCIFS error

> -----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
	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

	Fix that and let us know if the problem persists.


The information contained in this e-mail is confidential and is
intended only for the use of the addressee(s).
If you receive this e-mail in error, any use, distribution or
copying of this e-mail is not permitted. You are requested to
forward unwanted e-mail and address any problems to the
MIM Holdings Limited Support Centre.

For general enquires:	++61 7 3833 8000
Support Centre e-mail:	supportcentre at mim.com.au
Support Centre phone:  	Australia 1800500646
        				International ++61 7 38338042

More information about the jcifs mailing list