Bug 131310 - LTC12970- Java printing does not work with CUPS Browsing directive on
LTC12970- Java printing does not work with CUPS Browsing directive on
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: IBMJava2-JRE (Show other bugs)
3.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: IBM Bug Proxy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-08-30 16:17 EDT by J. Lewis Muir
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-04-08 11:25:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test case program (1.72 KB, text/plain)
2004-08-30 16:22 EDT, J. Lewis Muir
no flags Details

  None (edit)
Description J. Lewis Muir 2004-08-30 16:17:33 EDT
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):
java-1.4.1-ibm-1.4.1.2-1jpp_2rh

How reproducible:
Always

Steps to Reproduce:
1. Compile the Java test case program provided with this bug report:
   $ javac LookupPrintServicesTestCase.java
2. $ redhat-config-printer
   Choose 'Action' -> 'Sharing...' and check 'Automatically find remote
   shared queues'. Uncheck 'Enable LPD protocol'. Click 'OK'. Click
   'Apply'. Choose 'Action' -> 'Quit'.
3. If you run the test case immediately after making this change, it
   won't always fail right away. Even if you restart the cups daemon it
   won't always fail right away. It seems that 15 seconds is a long
   enough wait to guarantee to see the failing behavior:
   $ sleep 15 && java LookupPrintServicesTestCase
4. Now repeat step 2 and 3 but in step 2, uncheck 'Automatically find
   remote shared queues'. You now get a list of printers which means
   Java applications can get the list of printers that are available for
   them to print to.


Actual Results:  Looking up print services.
FAILED: PrintServiceLookup.lookupPrintServices returned empty list.


Expected Results:  This will of course vary depending on what printers are configured in
CUPS. The test case assumes there is at least one printer configured on
the computer such that 'lpstat -a' returns a list containing at least
this one printer.

---
Looking up print services.
Found print services:
  Service 0: Unix Printer : duck
  Service 1: Unix Printer : otter
OK: PrintServiceLookup.lookupPrintServices worked correctly.
---


Additional info:

I get the same behavior with Sun's J2EE 1.4_01 SDK.

The Java source code for the simple Java test case program that
demonstrates this bug is an attachment on this bug report.
Comment 1 J. Lewis Muir 2004-08-30 16:22:16 EDT
Created attachment 103268 [details]
Test case program
Comment 2 Thomas Fitzsimmons 2004-09-24 11:25:11 EDT
Does lpstat -s show the expected printer list when Browsing is enabled?
Comment 3 J. Lewis Muir 2004-09-24 11:49:37 EDT
Yes.
Comment 4 Thomas Fitzsimmons 2004-09-24 11:56:22 EDT
OK, then this is likely a bug in the Java printing code.  I'll ask IBM
about it.
Comment 5 mark wisner 2005-03-04 09:23:40 EST
Adding Mark Wisner to the cc list.
Comment 6 IBM Bug Proxy 2005-03-04 16:01:37 EST
---- Additional Comments From chavez@us.ibm.com(prefers email via lnx1138@us.ibm.com)  2005-03-04 15:59 EST -------
Reported bug to Java group. Eureka system PMR # is 80681,001,866 
Comment 7 IBM Bug Proxy 2005-03-11 10:38:25 EST
---- Additional Comments From chavez@us.ibm.com(prefers email via lnx1138@us.ibm.com)  2005-03-11 10:33 EST -------
Some updates from Java group. I need to ask if they tried recreating the problem
with the specified JVM as the noted builds don't seem to be the same though they
mentione Sr1a which from my understanding was the same as the reported JVM build.


I have tried the latest development build of 1.4.2 and the test case has
passed:

java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 2.2)
IBM J9SE VM (build 2.2, J2RE 1.4.2 IBM J9 2.2 Linux amd64-64
j9xa64142-20050307 (JIT enabled)
J9VM - 20050209_1437_LHdSMr
JIT  - r7_level20050120_1805)
[schan@bigbox java]$ lpstat -a
gbhurl77 accepting requests since Jan 01 00:00
[schan@bigbox java]$ java LookupPrintServicesTestCase
Looking up print services.
Found print services:
Service 0: Unix Printer : gbhurl77
OK: PrintServiceLookup.lookupPrintServices worked correctly.
[schan@bigbox java]$

And I have tried to use SR1a and I have got the same result too.

java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 2.2)
IBM J9SE VM (build 2.2, J2RE 1.4.2 IBM J9 2.2 Linux amd64-64
j9xa64142sr1a-20050225 (JIT enabled)
J9VM - 20050224_1940_LHdSMr
JIT  - r7_level20050120_1805)
[schan@bigbox java]$ /opt/IBMJava2-amd64-142/jre/bin/java
LookupPrintServicesTestCase
Looking up print services.
Found print services:
Service 0: Unix Printer : gbhurl77
OK: PrintServiceLookup.lookupPrintServices worked correctly.

So I would suggest user to retry with the test with SR1a JVM and
see what happens.

Thanks 
Comment 8 IBM Bug Proxy 2005-03-21 10:10:31 EST
---- Additional Comments From chavez@us.ibm.com(prefers email via lnx1138@us.ibm.com)  2005-03-21 10:04 EST -------
Requested status update from Java team. 
Comment 9 IBM Bug Proxy 2005-03-24 10:51:07 EST
---- Additional Comments From chavez@us.ibm.com(prefers email via lnx1138@us.ibm.com)  2005-03-24 10:48 EST -------
Can you confirm this problem is on RHEL 3 U4 and give the output of the java
-version command? We've had other redhat reported problems against RHEL 4
recently and java 1.4.2 being worked and so when I submitted them all to Java
they were lumped under that assumption which apperently was incorrect. I
apologize. So far they have not been able to recreate this with RHEL 4 and IBM
1.4.2 JDK. 
Comment 10 J. Lewis Muir 2005-04-01 19:54:46 EST
I tried testing things again and cannot reproduce the problem so it seems to have gone away.

I tested on RHEL WS v.3 w/ all software updates applied using the RHEL WS v.3 IBM JDK and the latest 
Sun 1.4.2 JDK:

$ /usr/bin/java -version
/usr/bin/java -version
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1)
Classic VM (build 1.4.1, J2RE 1.4.1 IBM build cxia321411-20040301 (JIT enabled: jitc))

$ /usr/local/bin/java -version
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
Comment 11 IBM Bug Proxy 2005-04-04 10:14:13 EDT
---- Additional Comments From chavez@us.ibm.com(prefers email via lnx1138@us.ibm.com)  2005-04-04 10:11 EST -------
Given the last update, can we close this bug? 

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