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

ClassCastException in UnixPrintJob for ipp printer

XMLWordPrintable

    • 2d
    • b06
    • solaris

      I have a single ipp printer on a Unix machine.
      lpstat -v returns for me something like
      device for printername: ipp://xx.xxx.xx.xx:631

      Now, running several of the old image-printing 2D tests, I'm getting this exception:

       javax.print.PrintException: java.lang.ClassCastException: sun.print.IPPPrintService cannot be cast to sun.print.UnixPrintService
        at sun.print.UnixPrintJob.print(UnixPrintJob.java:418)
        at EventHandling.print(EventHandling.java:279)
        at EventHandling.start(EventHandling.java:168)
      etc., because of the cast in line 413

      Looking in the code, we see in UnixPrintJob.java at line 409:
                      if (!(service instanceof IPPPrintService &&
                          ((IPPPrintService)service).isIPPSupportedImages(
                                                      flavor.getMimeType()))) {
                          printableJob(new ImagePrinter(instream));
                          ((UnixPrintService)service).wakeNotifier();
                          return;
                      }

      Apparently, I have an IPP print service which doesn't support certain given mime type.

       

            prr Philip Race
            yan Yuri Nesterenko
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: