Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8186987

NullPointerException in RasterPrinterJob without PrinterResolution

    Details

    • Subcomponent:
      2d
    • Introduced In Version:
      9
    • Resolved In Build:
      b25
    • CPU:
      generic
    • OS:
      generic

      Description

      FULL PRODUCT VERSION :
      java version "9"
      Java(TM) SE Runtime Environment (build 9+181)
      Java HotSpot(TM) Server VM (build 9+181, mixed mode, emulated-client)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 10.0.14393]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Printer driver: Brother HL-2240D series

      A DESCRIPTION OF THE PROBLEM :
      Printing to my network printer "Brother HL-2240D series" failed with a NPE. I use the PrinterJob API. See the stacktrace below. To other printers like CutePDF it is working.

      The passed attributeset contains the follow values:

      {class javax.print.attribute.standard.MediaPrintableArea=(12.7,12.7)->(184.626,271.621)mm, class javax.print.attribute.standard.Media=iso-a4, class javax.print.attribute.standard.PageRanges=1, class javax.print.attribute.standard.OrientationRequested=portrait, class javax.print.attribute.standard.JobName=Report1, class javax.print.attribute.standard.Chromaticity=monochrome}

      REGRESSION. Last worked in version 8u152


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.NullPointerException
      at java.desktop/sun.print.RasterPrinterJob.setAttributes(RasterPrinterJob.java:1240)
      at java.desktop/sun.awt.windows.WPrinterJob.setAttributes(WPrinterJob.java:696)
      at java.desktop/sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1510)
      at com.inet.viewer.PrinterJobProgress.run(PrinterJobProgress.java:134)
      at java.base/java.lang.Thread.run(Thread.java:844)

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                psadhukhan Prasanta Sadhukhan
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: