Random "Printer is not accepting job" PrinterExceptions
I have a Java 5 printing application that runs on W2K3. There are multiple TCP/IP printers defined (local printers w/ TCP/IP ports). Each night the app prints almost 100 documents. Occassionally, I will get a java.awt.print.PrinterException: Printer is not accepting job. These appear to be totally random and unrelated to problems on the printer. In fact I can get jobs to queue up when the printer is down, out of paper or toner. The problem happens with different printers and different printer models. What are the conditions under which this exception is generated? I've never been able to reproduce the problem (only see evidence in the logs), so it has been very difficult to debug. Is there a way to force Java to queue up the job even if the "printer is not accepting jobs"?
[791 byte] By [
wtellisa] at [2007-10-3 4:30:06]

Hello,
I also encounter some problemns with printing. We send some data to the printer and it prints. But randomly it goves the error "Printer is not accepting job". Does anyone know what this problem causes? And how to solve it?
If we give it a retry in a few seconds then the printer doesn't give this status back. It looks like a little bug. Does someone know more about it?
Hello all,
same situation with us. We run quite a lot of distributed Windows 2K3 servers (more than 300) with an average of about 20 Windows XP Professional Clients connected to each, resulting in > 6.000 Java VMs. Printers are connected via network.
Occasionally we get "java.awt.print.PrinterException: Printer is not accepting job" errors, which are extremely disturbing especially with server side print jobs. We were not able to reproduce the bug yet; in our tests the exception was not raised even with printer switched off, out of paper, not connected etc.
Any hints or advices would be highly appreciated.
Cheers,
Udo
Are you using Java 5 or 6? We're currently on 5 and contemplating an upgrade to 6. The problem still occurs w/ the latest version of 5, though it's mostly an annoyance since we can retry the jobs and they always eventually go through.
We have Java 5 Update 10 in place - the application server runs with "server" option.
We are about to introduce an automatic retry mechanism, so your hint that the job is finally successful after retrying is very valuable for us. Do you have any figures how many retries are ususally neccessary? Thanks in advance!
Message was edited by:
Udo.Schwedt
It's variable. We retry every 5 min for 24 hrs. Most go through on the first retry. Some get stuck for hours, but eventually make it. I suspect in the later case it's really due to a problem at the printer side, but we have no real way of knowing. The fact that the behavior is so unpredictable is annonying. During debugging, we can take a printer offline and not get this error (jobs queue up within Windows), while in production we seem to get this error for no reason.
Hello, i have the same problem.
I tried to loop with a maximum delay 25 sec, but the problem still occurs:
public static void Print(String fileName, String printerName) throws Exception
{
int tentatives = 0;
while(tentatives < 10)
{
try
{
PDFPrint pdfPrint = new PDFPrint (fileName, null);
pdfPrint.print (printerName, new PrintSettings ());
tentatives = 10;
}
catch(java.awt.print.PrinterException pe)
{
if(tentatives < 10)
{
Thread.sleep(2500);
tentatives ++;
}
else
{
throw new Exception(pe.getMessage()+" nombre de tentatives : "+ tentatives);
}
}
}
}