--- old/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java 2015-11-06 16:16:02.035682123 +0530 +++ new/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java 2015-11-06 16:16:01.883606126 +0530 @@ -740,7 +740,19 @@ } updatePageAttributes(service, page); - PageFormat newPage = pageDialog(attributes); + PageFormat newPage = null; + DialogTypeSelection dts = + (DialogTypeSelection)attributes.get(DialogTypeSelection.class); + if (dts == DialogTypeSelection.NATIVE) { + // Remove DialogTypeSelection.NATIVE to prevent infinite loop in + // RasterPrinterJob. + attributes.remove(DialogTypeSelection.class); + newPage = pageDialog(attributes); + // restore attribute + attributes.add(DialogTypeSelection.NATIVE); + } else { + newPage = pageDialog(attributes); + } if (newPage == null) { return page; @@ -881,7 +893,7 @@ PrintService service = java.security.AccessController.doPrivileged( new java.security.PrivilegedAction() { public PrintService run() { - PrintService service = getPrintService(); + PrintService service = getPrintService(); if (service == null) { ServiceDialog.showNoPrintService(gc); return null;