views:

78

answers:

0

I am using a third-party PDF Java print API that uses the Java Print API. The API is used in a WebLogic 10.2 server runtime environment. My problem is that after the server has been running for a day or so, the API is no longer able to see the printers that are set up on a local print server. Issuing lpstat -a from the command line returns all of the printers as does a simple java app that I run from the command line. I have written a simple JSP page to dump out the available PrintServices so I can check to see what's available in the server runtime environment and after a day or so there are none.

The application runs in a cluster and the PrintServices show up just fine on one of the nodes, but the second node is the one that always has a problem. It's not making a lot of sense at this point but any insight into what would cause PrintServices to suddenly become unnoticed by the Java Print API in runtime would be very helpful!

Here is the code from the JSP that checks for the PrintServices:

Available Printers:

    <% // List printers javax.print.PrintService [] ps = java.awt.print.PrinterJob.lookupPrintServices(); for (int count = 0; count < ps.length; ++count) { %>
  • <%=ps [count].getName()%> (PrintService class: <%=ps [count].getClass().getName()%>)
  • <% } %>