[jcifs] jcifs.smb.SmbException: The handle is invalid.

btandel bhargav.tandel at highq.com
Thu Nov 28 07:05:17 MST 2013


I am getting jcifs.smb.SmbException: The handle is invalid while copying 
a file. This error occurs in the middle of copying.

SmbFileInputStream fin = null;
SmbFile file = new SmbFile("path");
fin = new SmbFileInputStream(file);

FileOutputStream fos = null;
File tmpFile = File.createTempFile("fileName", "docextention");
try
{
	fos = new FileOutputStream(tmpFile);
	byte[] b = new byte[1048576];
	int count = 0;
	while ((count = fin.read(b)) > 0)
	{
		fos.write(b, 0, count);
	}
	// System.out.println("fos" + fos.toString());
}
catch (Exception e)
{
	logger.error(e.getMessage());
	new ExceptionHandler().exceptionMail(e);
} 

Error is generated from line : while ((count = fin.read(b)) > 0)

jcifs.smb.SmbException: The handle is invalid.
<br>	at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:563)
<br>	at jcifs.smb.SmbTransport.send(SmbTransport.java:663)
<br>	at jcifs.smb.SmbSession.send(SmbSession.java:238)
<br>	at jcifs.smb.SmbTree.send(SmbTree.java:119)
<br>	at jcifs.smb.SmbFile.send(SmbFile.java:775)
<br>	at jcifs.smb.SmbFileInputStream.readDirect(SmbFileInputStream.java:181)
<br>	at jcifs.smb.SmbFileInputStream.read(SmbFileInputStream.java:142)
<br>	at jcifs.smb.SmbFileInputStream.read(SmbFileInputStream.java:132)
<br>	at
com.os.util.helper.ReplicationUtil.getFileFromRepository(ReplicationUtil.java:856)
<br>	at com.os.util.helper.ReplicationUtil.getFile(ReplicationUtil.java:890)
<br>	at
com.os.gfnactions.contentmanager.document.DocumentDownloadHelper.downloadFileInputStream(DocumentDownloadHelper.java:263)
<br>	at
com.os.gfnactions.contentmanager.document.DocumentDownloadHelper.downloadFileInputStream(DocumentDownloadHelper.java:62)
<br>	at
com.os.gfnactions.contentmanager.document.documentDownload.docDownload(documentDownload.java:485)
<br>	at
com.os.gfnactions.contentmanager.document.documentDownload.documentDownload(documentDownload.java:333)
<br>	at sun.reflect.GeneratedMethodAccessor10940.invoke(Unknown Source)
<br>	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
<br>	at java.lang.reflect.Method.invoke(Method.java:601)
<br>	at
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
<br>	at
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
<br>	at
com.os.interceptor.BackgroundProcess$1.run(BackgroundProcess.java:56)
<br>	at java.lang.Thread.run(Thread.java:722)
<br>


I am using JCIFS 1.3.17 in the production. 
Anyone know about that exception please reply.

Thanks,
Bhargav



--
View this message in context: http://samba.2283325.n4.nabble.com/jcifs-smb-SmbException-The-handle-is-invalid-tp4657194.html
Sent from the Samba - jcifs mailing list archive at Nabble.com.


More information about the jCIFS mailing list