JDK-8038106 : PIT: access problem to a PrinterJob on OS X
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2014-03-21
  • Updated: 2014-08-18
  • Resolved: 2014-03-21
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.
JDK 8 JDK 9
8u20Fixed 9 b08Fixed
Description
We have apparently some security by-product bug on Mac.
Run this simple code with b06 PIT build of jdk9:

import java.awt.print.*;
public class PriJo {
    public static void main(String args[]) {
        PrinterJob pj = PrinterJob.getPrinterJob();
        PageFormat pf = pj.pageDialog(new PageFormat());
    }
}

It will fail with 
Exception in thread "main" java.awt.AWTError: Could not access PrinterJob: sun.lwawt.macosx.CPrinterJob
	at java.awt.print.PrinterJob$1.run(PrinterJob.java:88)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.print.PrinterJob.getPrinterJob(PrinterJob.java:77)
	at PriJo.main(PriJo.java:4)

It's new issue in this PIT only. Could it be a stopper?
Comments
Depends what you are running against. The fix is in dev as of yesterday.
02-04-2014

it haven't again in our sqe nighlty test. see log:http://scaaa008.us.oracle.com:9502/runs%2F448641.CORELIBS-JDK-NIGHTLY-SQE-2/results/ResultDir/swingPrintJobTest/swingPrintJobTest.log Match failures for aurora: RULE Permissions/swingPrintJobTest Exception java.awt.AWTError: Could not access PrinterJob: sun.lwawt.macosx.CPrinterJob
02-04-2014

Regression of JDK-8029868.
21-03-2014

All tests with getPrinterJob in 2D and AWT functional suites fail.
21-03-2014