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

PrintServiceLookup on Linux does not show any printers, while jre1.4.2_05 does

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0, 5.0u1
    • client-libs
    • None
    • 2d
    • x86
    • linux

      ULL PRODUCT VERSION :
      java version "1.5.0-rc"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-rc-b63)
      Java HotSpot(TM) Client VM (build 1.5.0-rc-b63, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Suse 9.1
      Linux testsystem 2.6.5-7.104-default #1 Wed Jul 28 16:42:13 UTC 2004 i686 i686 i386 GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      PrintService does not return any printers on Linux. Using same code with java 1.4.2 does return all printers.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      run the attached code

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      A list with names of printers installed on the system
      ACTUAL -
      No printers where found. when I use jdk 1.4.2_05 it does work

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.print.*;
      import javax.print.*;
      import javax.print.attribute.*;
      import java.text.*;
      import javax.print.attribute.standard.*;

      public class ShowPrinters {
          
          public ShowPrinters() {
          }
          
          public static void main(String[] args) {
              DocFlavor myFormat = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
              PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
              PrintService[] services =PrintServiceLookup.lookupPrintServices(myFormat, aset);
              System.out.println("The following printers are available");
              for (int i=0;i<services.length;i++) {
                  System.out.println(" service name: "+services[i].getName());
              }
          }
      }
      ---------- END SOURCE ----------
      ###@###.### 10/7/04 16:04 GMT

            jgodinez Jennifer Godinez (Inactive)
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: