JDK-4968560 : Printing not working on mercury b12 with jdk 1.4.2_04 Build 01
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.2_02,1.4.2_04
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris,windows_nt
  • CPU: x86
  • Submitted: 2003-12-15
  • Updated: 2004-04-28
  • Resolved: 2004-02-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2_05 05Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Both Printing to file and printing to printer not working in 1.4.2_04 Build 01
Steps to reproduce:
1) Run the attached testcase TestPrint in 1.4.2_04 Build 01 on Mercury build 12
2) Click on the print button, and choose either file or printer as target.
3) Testcase will not print anything(In case of file print it will make empty
   page file) and neither it will give any exception.

Note:
- Testcase works with 1.4.2 fcs and with tiger builds.
- Mercury build 12 used is having cupsd installed and running
  and having a default printer.

###@###.### 2003-12-15

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.4.2_05 generic tiger-beta2 FIXED IN: 1.4.2_05 tiger-beta2 INTEGRATED IN: 1.4.2_05 tiger-b40 tiger-beta2 VERIFIED IN: 1.4.2_05
14-06-2004

EVALUATION Since the problem doesn't exist in tiger, the development team won't be working on it. In order to get a fix in a 1.4.2 update release, this bug needs to be escalated. This bug should be marked tiger-na. ###@###.### 2003-12-15 The print operation is done by a separate thread, "printerJobThread", running async to the awt-eventqueue thread. And hence, if the PrintJob.end() is called the method does not wait for the printer thread to complete creating the .ps file. But closes it prematurely, causing some PS tags not written into the file. This incomplete file when submitted to `lpr -P<prn> <file>` command is not getting printed. ###@###.### 2004-01-14
14-01-2004

SUGGESTED FIX in j2se/src/share/classes/sun/print/PrintJob2D.java update the end() method to wait for printer thread. public void end(){ if (currentGraphics != null){ graphicsDrawn.append(currentGraphics); try{ + if( printerJobThread != null && printerJobThread.isAlive() ){ + printerJobThread.wait(); + } RasterPrinterJob rpj = (RasterPrinterJob)printerJob; rpj.endDoc(); }catch (Exception e){ } } graphicsToBeDrawn.close(); graphicsDrawn.closeWhenEmpty(); } ###@###.### 2004-01-14
14-01-2004