java.lang.NullPointerException: null

JDK Bug System | Webbug Group | 6 months ago
  1. 0

    FULL PRODUCT VERSION : java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) ADDITIONAL OS VERSION INFORMATION : Microsoft Windows [Version 6.1.7601] A DESCRIPTION OF THE PROBLEM : Our application uses OHJ (Oracle Help For Java) and is deployed on glassfish server. When using the print function to print a topic in the ICE Browser, the following exception is thrown: java.lang.NullPointerException: null at sun.awt.windows.WPrinterJob.getPrintService(WPrinterJob.java:632) ~[na:na] at sun.print.RasterPrinterJob.setPrintable(RasterPrinterJob.java:1047) ~[na:na] at oracle.help.htmlBrowser.print.ICEPrintImplJava2._doJava2Printing(ICEPrintImplJava2.java:109) ~[na:na] at oracle.help.htmlBrowser.print.ICEPrintImplJava2.printURLs(ICEPrintImplJava2.java:79) ~[na:na] at oracle.help.htmlBrowser.print.ICEPrintImplJava2.printURL(ICEPrintImplJava2.java:64) ~[na:na] at oracle.help.htmlBrowser.ICEBrowser.printURL(ICEBrowser.java:151) ~[na:na] at oracle.help.topicDisplay.print.BrowserPrintJob.printTopicImpl(BrowserPrintJob.java:45) ~[na:na] at oracle.help.topicDisplay.print.BaseTopicPrintJob$PrintingThread.run(BaseTopicPrintJob.java:49) ~[na:na] at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_60]|#] The print function works when starting glassfish with JDK jdk1.8.0_45. The problem started occuring from jdk1.8.0_60. REGRESSION. Last worked in version 8u73 ADDITIONAL REGRESSION INFORMATION: java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Use the print function from ICE Browser of Oracle Help. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Open print dialog ACTUAL - NullPointer Exception ERROR MESSAGES/STACK TRACES THAT OCCUR : java.lang.NullPointerException: null at sun.awt.windows.WPrinterJob.getPrintService(WPrinterJob.java:632) ~[na:na] at sun.print.RasterPrinterJob.setPrintable(RasterPrinterJob.java:1047) ~[na:na] at oracle.help.htmlBrowser.print.ICEPrintImplJava2._doJava2Printing(ICEPrintImplJava2.java:109) ~[na:na] at oracle.help.htmlBrowser.print.ICEPrintImplJava2.printURLs(ICEPrintImplJava2.java:79) ~[na:na] at oracle.help.htmlBrowser.print.ICEPrintImplJava2.printURL(ICEPrintImplJava2.java:64) ~[na:na] at oracle.help.htmlBrowser.ICEBrowser.printURL(ICEBrowser.java:151) ~[na:na] at oracle.help.topicDisplay.print.BrowserPrintJob.printTopicImpl(BrowserPrintJob.java:45) ~[na:na] at oracle.help.topicDisplay.print.BaseTopicPrintJob$PrintingThread.run(BaseTopicPrintJob.java:49) ~[na:na] at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_60]|#] REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- public PrintService getPrintService() { if (myService == null) { String printerName = getNativePrintService(); if (printerName != null) { myService = Win32PrintServiceLookup.getWin32PrintLUS(). getPrintServiceByName(printerName); // no need to call setNativePrintService as this name is // currently set in native if (myService != null) { return myService; } } myService = PrintServiceLookup.lookupDefaultPrintService(); if (myService instanceof Win32PrintService) { try { setNativePrintServiceIfNeeded(myService.getName()); } catch (Exception e) { myService = null; } } } return myService; } Win32PrintServiceLookup.getWin32PrintLUS() is null ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Use jdk 1.8.0_45 for starting glassfish.

    JDK Bug System | 6 months ago | Webbug Group
    java.lang.NullPointerException: null
  2. 0

    Java Web start printing job

    Stack Overflow | 3 years ago | bluchip.gr
    java.lang.NullPointerException
  3. 0

    HQL Exception (org.hibernate.dialect.Dialect$3)

    Stack Overflow | 4 years ago | Hari
    java.lang.NullPointerException: null
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Error loading model properties in JPA on play 2.0.3

    Stack Overflow | 4 years ago | Chappies
    java.lang.NullPointerException: null

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      null

      at sun.awt.windows.WPrinterJob.getPrintService()
    2. Java RT
      RasterPrinterJob.setPrintable
      1. sun.awt.windows.WPrinterJob.getPrintService(WPrinterJob.java:632)[na:na]
      2. sun.print.RasterPrinterJob.setPrintable(RasterPrinterJob.java:1047)[na:na]
      2 frames
    3. oracle.help.htmlBrowser
      ICEBrowser.printURL
      1. oracle.help.htmlBrowser.print.ICEPrintImplJava2._doJava2Printing(ICEPrintImplJava2.java:109)[na:na]
      2. oracle.help.htmlBrowser.print.ICEPrintImplJava2.printURLs(ICEPrintImplJava2.java:79)[na:na]
      3. oracle.help.htmlBrowser.print.ICEPrintImplJava2.printURL(ICEPrintImplJava2.java:64)[na:na]
      4. oracle.help.htmlBrowser.ICEBrowser.printURL(ICEBrowser.java:151)[na:na]
      4 frames
    4. oracle.help.topicDisplay
      BaseTopicPrintJob$PrintingThread.run
      1. oracle.help.topicDisplay.print.BrowserPrintJob.printTopicImpl(BrowserPrintJob.java:45)[na:na]
      2. oracle.help.topicDisplay.print.BaseTopicPrintJob$PrintingThread.run(BaseTopicPrintJob.java:49)[na:na]
      2 frames