Problem while Printing through Networkwork Printer using JCIFS

Thiyagu Venkatesan v.thiyagu.mca at
Wed Apr 30 14:32:54 GMT 2008

Hi All,

I have a problem while printing through Network Printer using JCIFS

OS :Windows
Printer : HPLaser

The problem is

1. I can able to find the available network printer.
2. I gotted the SmbFile object for the specific Network Printer.
3. When I try to do the following piece of code fos=file.getOutputStream();  //where file is object of
SmbFile.....i.e shared network printer ps=new;
  ps.print("God is Great");
  ps.print("ALL THE BEST");
  System.out.println("File Writed");

 Im getting the following error

The parameter is incorrect.
at jcifs.smb.SmbTransport.checkStatus(
at jcifs.smb.SmbTransport.send(
at jcifs.smb.SmbSession.send(
at jcifs.smb.SmbTree.send(
at jcifs.smb.SmbFile.send(
at jcifs.smb.SmbFile.open0(
at jcifs.smb.SmbFileOutputStream.<init>(
at jcifs.smb.SmbFileOutputStream.<init>(
at jcifs.smb.SmbFileOutputStream.<init>(
at jcifs.smb.SmbFile.getOutputStream(
at javaprint.LocateNetPrinter.findAllPrinters(
at javaprint.LocateNetPrinter.main(
Exception in thread "main"

Can anybody help me to get the OutputStream of Printer, so that I can able
to print the msg in Printer.

Reply me..........

Thanks in Advance

More information about the samba-technical mailing list