United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4968560 : Printing not working on mercury b12 with jdk 1.4.2_04 Build 01

Details
Type:
Bug
Submit Date:
2003-12-15
Status:
Closed
Updated Date:
2004-04-28
Project Name:
JDK
Resolved Date:
2004-02-20
Component:
client-libs
OS:
solaris,windows_nt
Sub-Component:
2d
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.4.2_02,1.4.2_04
Fixed Versions:
1.4.2_05 (05)

Related Reports
Backport:
Duplicate:
Relates:
Relates:

Sub Tasks

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


                                     
2004-06-14
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
                                     
2004-01-14
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
                                     
2004-01-14



Hardware and Software, Engineered to Work Together