JDK-8229534 : PrinterJob's printDialog method not working in macOS 10.15 Beta
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 12.0.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: x86
  • Submitted: 2019-08-13
  • Updated: 2019-08-14
  • Resolved: 2019-08-14
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
macOS 10.5 Catalina Beta

A DESCRIPTION OF THE PROBLEM :
Trying to open AWT's print dialog in macOS 10.15 Catalina shows a very similar error that the one in JDK-8227836:

2019-08-12 18:30:55.588 java[24288:410470] +[NSXPCSharedListener endpointForReply:withListenerName:]: an error occurred while attempting to obtain endpoint for listener 'com.apple.view-bridge': Connection interrupted
2019-08-12 18:30:55.588 java[24288:410388] *** Assertion failure in -[RemotePDEHost loadRemotePDEHost], /BuildRoot/Library/Caches/com.apple.xbs/Sources/PrintingPlugins/PrintingPlugins-607/PrintCocoaUI/RemotePDEHost.mm:546

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The print dialog should open without any error.
ACTUAL -
2 errors are printed before the dialog is opened.

---------- BEGIN SOURCE ----------
import java.awt.Graphics;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;

public class PrintTest implements Printable {
  public int print(Graphics g, PageFormat pf, int pageIndex) {
    g.drawString("Some text in the page.", 144, 144);
    return PAGE_EXISTS;
  }

  public static void main(String[] args) {
    PrinterJob pj = PrinterJob.getPrinterJob();
    pj.setPrintable(new PrintTest());
    if (pj.printDialog()) {
      try {
        pj.print();
      } catch (PrinterException e) {
        System.out.println(e);
      }
    }
  }
}
---------- END SOURCE ----------


Comments
Closing this as duplicate of JDK-8227836.
14-08-2019

Issue is reported with macos 10.15 (Catalina) and seems similar to JDK-8227836 which is open.
14-08-2019