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

PrinterJob.lookupPrintServices cannot find any printers (HP 8150, HP 4550)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 1.4.0, 1.4.1
    • client-libs
    • 2d
    • tiger
    • x86
    • linux



      Name: jk109818 Date: 07/10/2002


      FULL PRODUCT VERSION :
      java version "1.4.1-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
      Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)

      This also did not work in earlier betas. Probably never worked.

      java version "1.4.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
      Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)


      FULL OPERATING SYSTEM VERSION : 2.4.18-64GB-SMP
      GLIBC: 2.2.5-38, ... SUSE 8.0 out of the box
      LPRng installed and working with other apps.


      EXTRA RELEVANT SYSTEM CONFIGURATION :

      The following is the printcap file. Note the printers
      are attached across the LAN and are not wired to local
      machine. Both configured using YAST, but that should not
      matter. Additional entries also don't work, but I'm
      making it simple for you. Even 1 printer does not work.

      jcn: :cm=lpdfilter method=raw color=no: :lp=###@###.###: :sd=/var/spool/lpd/jcn: :lf=/var/spool/lpd/jcn/log: :af=/var/spool/lpd/jcn/acct: :ar:force_localhost@: :tr=:cl:sh:

      hal: :cm=lpdfilter method=raw color=yes: :lp=###@###.###: :sd=/var/spool/lpd/hal: :lf=/var/spool/lpd/hal/log: :af=/var/spool/lpd/hal/acct: :ar:force_localhost@: :tr=:cl:sh:




      A DESCRIPTION OF THE PROBLEM :
      There are several (In the example above 2) printers configured
      on the SuSE 8.0 system. Java cannot find them so it cannot
      print.

      Note I'm using network printers, not locally attached, I have
      no local ones to try. Specifically an HP 8150 and and HP 4550
      both with JetDirect attachments.

      Note: /usr/bin/lpc is installed on the system as per the
      java beta instructions as a pre-req for printing.




      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.Install printers with LPRng (use YAST in SuSE 8.0 if you like)
      2.Try printing with Java, sample is below. No printers found


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Java should find all the printers listed in printcap file.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      This is a case of silent death.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.print.*;
      import javax.print.*;

      public class Test
      {
        public static void main(String[] args)
        {
           PrinterJob printerJob;
           PrintService[] printServices;

           printerJob = PrinterJob.getPrinterJob();
           printServices = printerJob.lookupPrintServices();
           System.out.println("Number of servies found: " + printServices.length);
        }
      }

      // Also note:
      // printerJob.printDialog() will also fail with an error message dialog
      // saying no services were found.

      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      Java works better with CUPS instead of LPRng.
      But, CUPS operation is buggy too, producing extra
      pages at the end of every job, not just java jobs.

      Java should not pre-req CUPS printing on SuSE. If it does
      it should be documented.

      OR can install RedHat 7.X -- ie put java apps on a seperate
      server and not print from java generally
      (Review ID: 159195)
      ======================================================================

            jgodinez Jennifer Godinez (Inactive)
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: