JDK-5024816 : Suntime2 printing produces java.awt.print.PrinterException error
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2004-04-01
  • Updated: 2004-04-01
  • Resolved: 2004-04-01
Related Reports
Duplicate :  
Description
Suntime2 is a payroll application (see suntime2.central). It is a 3rd party vendor application and uses Java Applets (jre1.4.1_02 or jre1.4.2.x). When users print from one of the screens, the following error occurs:


java.awt.print.PrinterException: No print service found.
	at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1006)
	at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:986)
	at com.kronos.wfc.wfp.uiframework.dialog.PrintDialog$ButtonPanel.OKButtonPressed([DashoPro-V2.1-110100])
	at com.kronos.wfc.wfp.uiframework.component.KronosButtonPanel$2.actionPerformed([DashoPro-V2.1-110100])
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
	at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
	at java.awt.Component.processMouseEvent(Component.java:5100)
	at java.awt.Component.processEvent(Component.java:4897)
	at java.awt.Container.processEvent(Container.java:1569)
	at java.awt.Component.dispatchEventImpl(Component.java:3615)
	at java.awt.Container.dispatchEventImpl(Container.java:1627)
	at java.awt.Component.dispatchEvent(Component.java:3477)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
	at java.awt.Container.dispatchEventImpl(Container.java:1613)
	at java.awt.Window.dispatchEventImpl(Window.java:1606)
	at java.awt.Component.dispatchEvent(Component.java:3477)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)
	at java.awt.Dialog$1.run(Dialog.java:540)
	at java.awt.Dialog.show(Dialog.java:561)
	at com.kronos.wfc.wfp.uiframework.dialog.KronosDialog.show_internal([DashoPro-V2.1-110100])
	at com.kronos.wfc.wfp.uiframework.dialog.KronosDialog.show([DashoPro-V2.1-110100])
	at com.kronos.wfc.wfp.uiframework.dialog.PrintDialog.displayDialog([DashoPro-V2.1-110100])
	at com.kronos.wfc.wfp.uiframework.dialog.PrintDialog.<init>([DashoPro-V2.1-110100])
	at com.kronos.wfc.wfp.uiframework.component.KronosPrinter.print([DashoPro-V2.1-110100])
	at com.kronos.wfc.wfp.uiframework.component.KronosPrinter.print([DashoPro-V2.1-110100])
	at com.kronos.wfc.wfp.uiframework.component.table.KronosTable.print([DashoPro-V2.1-110100])
	at com.kronos.wfc.applets.summary.SummaryTablePanel.printTable([DashoPro-V2.1-110100])
	at com.kronos.wfc.applets.summary.SummaryGUIController.printTable([DashoPro-V2.1-110100])
	at com.kronos.wfc.applets.summary.SummaryGUIController.handlePrintAction([DashoPro-V2.1-110100])
	at com.kronos.wfc.applets.summary.SummaryGUIController$GroupActionListener.actionPerformed([DashoPro-V2.1-110100])
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
	at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
	at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
	at java.awt.Component.processMouseEvent(Component.java:5100)
	at java.awt.Component.processEvent(Component.java:4897)
	at java.awt.Container.processEvent(Container.java:1569)
	at java.awt.Component.dispatchEventImpl(Component.java:3615)
	at java.awt.Container.dispatchEventImpl(Container.java:1627)
	at java.awt.Component.dispatchEvent(Component.java:3477)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
	at java.awt.Container.dispatchEventImpl(Container.java:1613)
	at java.awt.Component.dispatchEvent(Component.java:3477)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Current thread:Thread[Finalizer,8,system]
OJIPlugin: No AThread

OJIPlugin acq Spontaneous pipe=10
Trying to enter spont monitor: 0
 OJIPlugin release for:Thread[Finalizer,8,system]
OJIPlugin releasePipe - exiting spont monitor
Printing error: java.awt.print.PrinterException: No print service found.

Comments
WORK AROUND 1) Sign the applet granting file read permission 2) Modify the applet to show the print dialog first. This works because there is an outer doPrivileged block surrounding the code that pops up the dialog, and it grants the file permssion too. Printing works in this case 3) Move to JDK 1.5 ###@###.### 2004-04-01 =============================
01-04-2004

EVALUATION Name: osR10079 Date: 03/31/2004 As far as I know 2D team is responsible for sun.print.RasterPrinterJob so I reassign the bug to 2D for further investigation. ###@###.### 2004-04-01 ====================================================================== The referenced application is apparently inaccessible except to registered users. So this cannot be investigated. Also it probably wouldn't help much even if it could be accessed except to run it on a different system. Common sense tells me that the 3rd party vendor would have reported this problem a long time ago if this were a general problem, so it seems likely that its a configuration problem. Is this a signed applet that has queuePrintJob permission? The trace in the bug report strongly suggests that there are no printers available on this system. The printing of the exception stack trace is apparently something the applet has chosen to do. Its not coming from the JDK. On the system on which the applet (ie the browser) is being executed what is the output of 1) /usr/bin/lpstat -d 2) /usr/bin/lpstat -v Marking the bug incomplete. ###@###.### 2004-04-01 ============================ The output of the above commands seems reasonable and I have found the problem which is actually bug 4930594, fixed in 1.5 It appears the applet isn't signed and plugin puts up a user dialog to question whether printing should proceed. This grants print permission but the problem is that a temporary file containing printer info can't be read, because its outside of a doPrivileged block. ###@###.### 2004-04-01 ============================
01-04-2004