1

この場合、デフォルトのプリンターで印刷する Windows 2008 サーバーの Tomcat から呼び出されるサーバー側の印刷機能があり、永久にハングします。これはスタック トレースです。

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)

犯人は、いくつかのバックグラウンド シェル コンテキスト (サーバーはユーザー Tomcat として実行されている Tomcat 5.5 です) でウィンドウを開くように見えるプリンター "Microsoft XPS ドキュメント ライター" であり、そこで永久にハングします。状況を処理します。

何か案は?プリンター名をハードコーディングして、印刷を禁止していますか? スレッドを停止しますか? これはネイティブ関数であるため、目的の結果でスレッドを interrupt() することはできません。

4

1 に答える 1

2

物理プリンターでも同様の問題がありました。私が Web で読んだことによると、Windows Server 2008 はユーザー インターフェイスのない特別なセッションでサービスを実行するため、ポップアップによってアプリケーションがハングします。

XPS Writer をサーバーから取り外して、実際のプリンターを使用できますか? または、XPS Writer を明示的にチェックし、ユーザーが XPS Writer に印刷できないようにしますか?

WS 2008 でユーザーの操作を可能にするさまざまな手法について Web で言及されているのを見てきましたが、それらがアプリケーションのニーズに適しているかどうかはわかりません。

于 2013-08-05T17:08:38.457 に答える