Java program returns error if printer is busy
I have an odd problem, wondered if anyone could help out. We're
preparing to implement Lawson's Mobile Supply Chain Management, and
they have a Java program that prints reports to some of our AIX
queues. Problem is, if the printer is busy printing a job, the Java
program returns an error:
[05-14-2008 09:00:37,230] ERROR
[com.lawson.mscm.rad.delivery.data.PrintDelivery] Couldn't get printer
job
Sounds silly right? I mean, the whole purpose of print QUEUEing is so
the application doesn't give a hoot whether the printer is busy or
not,but for some odd reason, this program won't print if there's a job
in the queue ahead of it. It does the same thing if we disable the
queue, then print two jobs in a row - the first jobs goes to the queue
fine, the next one returns the error.
I've tried defining the queue as a remote (LPR) queue, as a standard
HP JetDirect queue, and also as a TCPPRint (marvelous print driver
from Laixsoft), and it seems to make no difference.
Ever heard of such a thing? Any suggestions?
Re: Java program returns error if printer is busy
"rodak" <robert.macnutt@nghs.com> wrote in message
news:b067fd0b-d454-496c-8954-73e8063729ca@24g2000hsh.googlegroups.com...[color=blue]
>I have an odd problem, wondered if anyone could help out. We're
> preparing to implement Lawson's Mobile Supply Chain Management, and
> they have a Java program that prints reports to some of our AIX
> queues. Problem is, if the printer is busy printing a job, the Java
> program returns an error:
>
> [05-14-2008 09:00:37,230] ERROR
> [com.lawson.mscm.rad.delivery.data.PrintDelivery] Couldn't get printer
> job
>
> Sounds silly right? I mean, the whole purpose of print QUEUEing is so
> the application doesn't give a hoot whether the printer is busy or
> not,but for some odd reason, this program won't print if there's a job
> in the queue ahead of it. It does the same thing if we disable the
> queue, then print two jobs in a row - the first jobs goes to the queue
> fine, the next one returns the error.
>
> I've tried defining the queue as a remote (LPR) queue, as a standard
> HP JetDirect queue, and also as a TCPPRint (marvelous print driver
> from Laixsoft), and it seems to make no difference.
>
> Ever heard of such a thing? Any suggestions?[/color]
Robert,
Wow - that is a strange one. I've never heard of this one before. I can
think of a workaround that might help.
Lets say that your print queue is called queue1 and works as you describe
below. What if you create a second queue that does nothing but requeue the
job over to another queue so that the new "incoming" queue wouldn't have a
backlog of job and always be ready?
Create a new queue that just discards the print job. I'll call this queue
"incoming":
smit mkpq
Print to a file
file in /dev: /dev/null
Now, modify the queue like this:
lsvirprt
select "incoming"
mo="qprt -Pqueue1"
So, now - if you queue a job over to "incoming" it will just pipe the print
job into "qprt -Pqueue1". That operation should be very fast and so the
queue should go back to ready within milliseconds so that a subsequent job
is not second in the queue.
This isn't a perfect solution because:
1) And command-line flags for formatting and such are not properly passed
over to Q1. So, "incoming" will do any formatting. You may have to play
with the qprt command in the virtual printer mo attribute to prevent the job
from double formatting and such. Perhaps "qprt -Pqueue1 -j! -J! -dp"
2) If the application queues up multiple jobs in rapid succession, there is
always that chance that job2 gets queued before job1 is moved from
"incoming" to "queue1"
Worth a shot though to see if it helps. Let me know how this works.
Best regards,
Paul Laymon
[email]laixsoft@laixsoft.com[/email]
[url]http://www.laixsoft.com[/url]