I have a server side printing function, called from Tomcat on Windows 2008 server, that prints on the default printer in this case, and it hangs forever. This is the stack trace:
at sun.awt.windows.WPrinterJob._startDoc(Native Method)
at sun.awt.windows.WPrinterJob.startDoc(WPrinterJob.java:1249)
at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1371)
at com.gnostice.pdfone.PdfPrinter.a(Unknown Source)
at com.gnostice.pdfone.PdfPrinter.print(Unknown Source)
at com.gnostice.pdfone.PdfPrinter.print(Unknown Source)
at de.ikoffice.print.PrintService.printPDF(PrintService.java:64)
at de.ikoffice.document.Document.printPDFToPrinter(Document.java:261)
at de.ikoffice.document.Document.start(Document.java:91)
at de.ikoffice.document.DocumentService.processMessage(DocumentService.java:48)
The culprit is the printer "Microsoft XPS document writer" which seems to open a window in some background shells context (The server is a Tomcat 5.5 running as user Tomcat), and hangs forever there, and I don't know whats the best way to handle the situation.
Any ideas? Hardcoding the printer name and disallowing to print on it? stop()ing the thread? It's a native function, so I cannot interrupt() the thread with the desired results.