[jcifs] writing a file to a printer queue.
frederic.kieffer at gerling.com
frederic.kieffer at gerling.com
Wed Oct 9 17:07:27 EST 2002
Hi everybody!
I'm sending this mail because I had a problem when writing a pcl file to a
printer queue.
You can see below the URL I'm using for creating the SmbFile object, and the
code part under this dump
[INFO,Default] [InvoicesPersonalPrinter] [sendToPrinter()] method called,
aSmbFi
le : smb://do-frpar02;U81422:poiaze@tafrpar0202/PHFRPAR0210/toto.pcl
(tafrpar0202: NT printer server, PHFRPAR0210 : printer (PCL compliant)).
private void sendToPrinter(byte[] bytesToBePrinted, SmbFile aSmbFile)
throws Exception
{
log.debug("[InvoicesPersonalPrinter] [sendToPrinter()] method called,
aSmbFile : " + aSmbFile.toString());
System.out.println("[InvoicesPersonalPrinter] [sendToPrinter()] method
called, aSmbFile : " + aSmbFile.toString());
//Write data into the printing queue for the relevant printer
SmbFileOutputStream aSmbFileOutputStream = new
SmbFileOutputStream(aSmbFile);
aSmbFileOutputStream.write(bytesToBePrinted);
aSmbFileOutputStream.flush();
aSmbFileOutputStream.close();
log.debug("[InvoicesPersonalPrinter] [sendToPrinter()] end of method ");
System.out.println("[InvoicesPersonalPrinter] [sendToPrinter()] end of
method ");
}
Here is the stack trace :
[ERROR,Default] [InvoicesPersonalPrinter] [sendToPrinter()] method raised an
ex
eption : Invalid parameter
[ERROR,Default] jcifs.smb.SmbException: Invalid parameter
[ERROR,Default] at
jcifs.smb.SmbTransport.send(SmbTransport.java:494)
[ERROR,Default]
[ERROR,Default] at jcifs.smb.SmbSession.send(SmbSession.java:97)
[ERROR,Default]
[ERROR,Default] at jcifs.smb.SmbTree.send(SmbTree.java:92)
[ERROR,Default]
[ERROR,Default] at jcifs.smb.SmbFile.send(SmbFile.java:532)
[ERROR,Default]
[ERROR,Default] at jcifs.smb.SmbFile.open(SmbFile.java:578)
[ERROR,Default]
[ERROR,Default] at
jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputSt
eam.java:107)
[ERROR,Default]
[ERROR,Default] at
jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputSt
eam.java:92)
[ERROR,Default]
[ERROR,Default] at
jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputSt
eam.java:62)
[ERROR,Default]
[ERROR,Default] at
gerling.invoices.InvoicesPersonalPrinter.sendToPrint
r(InvoicesPersonalPrinter.java:83)
[ERROR,Default]
[ERROR,Default] at
gerling.invoices.InvoicesPersonalPrinter.<init>(Invo
cesPersonalPrinter.java:65)
[ERROR,Default]
[ERROR,Default] at
gerling.invoices.InvoicesPrinter.transformToPDF(Invo
cesPrinter.java:273)
[ERROR,Default]
[ERROR,Default] at
gerling.invoices.InvoicesPrinter.print(InvoicesPrint
r.java:236)
[ERROR,Default]
[ERROR,Default] at
gerling.invoices.InvoicesPrinter.onMessage(InvoicesP
inter.java:188)
[ERROR,Default]
[ERROR,Default] at
org.jboss.mq.SpyMessageConsumer.run(SpyMessageConsum
r.java:490)
[ERROR,Default]
[ERROR,Default] at java.lang.Thread.run(Thread.java:484)
Thanks for any help!
Frédéric Kieffer
Gerling France
More information about the jcifs
mailing list