Bug 688480 - java print returned an empty list of print services if the "Browsing"
Summary: java print returned an empty list of print services if the "Browsing"
Keywords:
Status: CLOSED DUPLICATE of bug 651381
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: cups
Version: 5.4
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: Tim Waugh
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-17 08:06 UTC by SEOK-BAE YOON
Modified: 2011-03-18 13:41 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-18 13:41:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description SEOK-BAE YOON 2011-03-17 08:06:54 UTC
Description of problem:
When using Java's javax.print.PrintServiceLookup.lookupPrintServices
method, it returns an empty list of print services if the "Browsing"
directive in CUPS is turned on. If the "Browsing" directive in CUPS is
turned off, it works correctly returning a list of printers.

Version-Release number of selected component (if applicable):
1) Linux : Redhat 5.4 (2.6.18-194.el5 #1 SMP)
2) CUPS : cups-1.3.7-11.el5
3) JAVA : java version "1.4.2_24-rev"
   Java(TM) Platform, Standard Edition for Business (build 1.4.2_24-rev-b06)
   Java HotSpot(TM) Client VM (build 1.4.2_24-rev-b06, mixed mode)

How reproducible:
Always

Steps to Reproduce:
1. There are two print servers using function below
    --> /etc/cups/cupsd.conf : Browsing
2. Compile the Java test case program provided with this bug report:
   $ javac Printer.java

   == Printer.java ==
   import javax.print.*;
   import java.io.*;
   import java.net.URI;

   public class Printer {
       public static void main( String args[] ) {
           PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
           for (int i = 0; i < services.length; i++) {
           System.out.println(services[i].getName());
           }
       }
   }

3. Run the java:
   $ java Printer.java
  
Actual results:


Expected results: returned empty list.


Additional info: output by commmand lp
[testserver:/sysopr/printer]lpstat -t
scheduler is running
system default destination: PRINTA
device for PRINTB: socket://10.10.10.1:9100
device for PRINTB@HOSTA: ipp://HOSTA:631/printers/PRINTB
device for PRINTA: socket://10.10.10.2:9100
device for PRINTA@HOSTA: ipp://HOSTA:631/printers/OSGROUP
PRINTB accepting requests since Wed 16 Mar 2011 08:35:35 AM KST
PRINTB@HOSTA accepting requests since Wed 16 Mar 2011 08:35:57 AM KST
PRINTA accepting requests since Wed 16 Mar 2011 08:35:35 AM KST
PRINTA@HOSTA accepting requests since Wed 16 Mar 2011 08:35:58 AM KST
printer PRINTB is idle.  enabled since Wed 16 Mar 2011 08:35:35 AM KST
printer PRINTB@HOSTA is idle.  enabled since Wed 16 Mar 2011 08:35:57 AM KST
printer PRINTA is idle.  enabled since Wed 16 Mar 2011 08:35:35 AM KST
printer PRINTA@HOSTA is idle.  enabled since Wed 16 Mar 2011 08:35:58 AM KST
[testserver:/sysopr/printer]
[testserver:/sysopr/printer]lpc status
PRINTB:
        printer is on device 'socket' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present
PRINTB@HOSTA:
        printer is on device '/dev/null' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present
PRINTA:
        printer is on device 'socket' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present
PRINTA@HOSTA:
        printer is on device '/dev/null' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present

Comment 1 Tim Waugh 2011-03-18 13:41:36 UTC

*** This bug has been marked as a duplicate of bug 651381 ***


Note You need to log in before you can comment on or make changes to this bug.