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

Frequent issue Java.awt.print.PrinterException: Invalid name of PrintService

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 7u80
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_2008

      Description

      FULL PRODUCT VERSION :
      java version "1.7.0_21"
      Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
      Java HotSpot(TM) Client VM (build 23.21-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft® Windows Server® 2008 Enterprise
      Version 6.0.6002 Service Pack 2 Build 6002


      A DESCRIPTION OF THE PROBLEM :
      Our java printing application use remote printing from Windows 2008 Server, we have configured 40/50 printers (HP, RICOH, EPSON, Canon, Printronix, etc..,) on the server for the demand printing

      Jasper report 4.1.2
      JVM 1.7.0_21

      When user prints few hundred reports then we face this exceptions especially if you have more Canon printer queues then the frequency of the issue is very often while your are requesting concurrent print jobs

      net.sf.jasperreports.engine.JRException: java.awt.print.PrinterException: Invalid name of PrintService.
      at net.sf.jasperreports.engine.export.JRPrintServiceExporter.exportReport(JRPrintServiceExporter.java:159)
      at com.ceva.ap.print.invokers.ReportPrinter.directPrinting(ReportPrinter.java:171)
      at com.ceva.ap.print.invokers.ReportPrinter.threadDirectedPrinting(ReportPrinter.java:300)
      at com.ceva.ap.print.core.MainPrinter.printData(MainPrinter.java:900)
      at com.ceva.ap.print.core.MainPrinter.runner(MainPrinter.java:157)
      at com.ceva.ap.print.core.RequestPrinter.printData(RequestPrinter.java:198)
      at com.ceva.ap.print.core.RequestPrinter.run(RequestPrinter.java:97)
      at java.lang.Thread.run(Thread.java:722)

      Caused by: java.awt.print.PrinterException: Invalid name of PrintService.
      at sun.awt.windows.WPrinterJob.setNativePrintService(Native Method)
      at sun.awt.windows.WPrinterJob.setPrintService(WPrinterJob.java:595)
      at net.sf.jasperreports.engine.export.JRPrintServiceExporter.exportReport(JRPrintServiceExporter.java:155)
      ... 7 more

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create few canon print queues in window servers and started giving concurrent print jobs to the queues from simple jasper printing multi thread applications - easily you can reproduce

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Print queue will print the documents
      ACTUAL -
      net.sf.jasperreports.engine.JRException: java.awt.print.PrinterException: Invalid name of PrintService.
      at net.sf.jasperreports.engine.export.JRPrintServiceExporter.exportReport(JRPrintServiceExporter.java:159)
      at com.ceva.ap.print.invokers.ReportPrinter.directPrinting(ReportPrinter.java:171)
      at com.ceva.ap.print.invokers.ReportPrinter.threadDirectedPrinting(ReportPrinter.java:300)
      at com.ceva.ap.print.core.MainPrinter.printData(MainPrinter.java:900)
      at com.ceva.ap.print.core.MainPrinter.runner(MainPrinter.java:157)
      at com.ceva.ap.print.core.RequestPrinter.printData(RequestPrinter.java:198)
      at com.ceva.ap.print.core.RequestPrinter.run(RequestPrinter.java:97)
      at java.lang.Thread.run(Thread.java:722)

      Caused by: java.awt.print.PrinterException: Invalid name of PrintService.
      at sun.awt.windows.WPrinterJob.setNativePrintService(Native Method)
      at sun.awt.windows.WPrinterJob.setPrintService(WPrinterJob.java:595)
      at net.sf.jasperreports.engine.export.JRPrintServiceExporter.exportReport(JRPrintServiceExporter.java:155)
      ... 7 more

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      net.sf.jasperreports.engine.JRException: java.awt.print.PrinterException: Invalid name of PrintService.
      at net.sf.jasperreports.engine.export.JRPrintServiceExporter.exportReport(JRPrintServiceExporter.java:159)
      at com.ceva.ap.print.invokers.ReportPrinter.directPrinting(ReportPrinter.java:171)
      at com.ceva.ap.print.invokers.ReportPrinter.threadDirectedPrinting(ReportPrinter.java:300)
      at com.ceva.ap.print.core.MainPrinter.printData(MainPrinter.java:900)
      at com.ceva.ap.print.core.MainPrinter.runner(MainPrinter.java:157)
      at com.ceva.ap.print.core.RequestPrinter.printData(RequestPrinter.java:198)
      at com.ceva.ap.print.core.RequestPrinter.run(RequestPrinter.java:97)
      at java.lang.Thread.run(Thread.java:722)

      Caused by: java.awt.print.PrinterException: Invalid name of PrintService.
      at sun.awt.windows.WPrinterJob.setNativePrintService(Native Method)
      at sun.awt.windows.WPrinterJob.setPrintService(WPrinterJob.java:595)
      at net.sf.jasperreports.engine.export.JRPrintServiceExporter.exportReport(JRPrintServiceExporter.java:155)
      ... 7 more

      REPRODUCIBILITY :
      This bug can be reproduced often.

      CUSTOMER SUBMITTED WORKAROUND :
      We have to restart our java printing application

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: