Created at 16:43 Dec 13, 2006 by philrace, last modified at 18:17 Dec 13, 2006
As noted in the CUPS 1.2 releases notes http://www.cups.org/documentation.php/whatsnew.html CUPS now supports Unix Domain Sockets:
Networking Domain Sockets; CUPS now supports the much faster UNIX domain sockets for local printingAs a consequence, by default CUPS on Unix/Linux is now configured to listen for connections on both
This can be an incompatible change for any pre-1.2 aware client which retrieves that name and expects to be able to use to open a TCP/IP connection.
In particular this breaks Sun's JDK (aka Java/aka Java SE, aka JRE) versions 1.5 and Java SE 6. ie all releases to date (Dec 2006) which connects to the CUPS IPP server to provide access to platform printing support. The symptom may be no printers found, or printers 'not accepting jobs'. This will be patched in the next available minor update releases of each of JDK 1.5 and JDK6. The Sun bug to track this can be viewed at http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6500903 and the updated releases in which this is fixed will then be viewable there. The expectation is that this will be fixed in JDK6 update 1 (1.6.0_01) and JDK 1.5 update 12 (1.5.0_12).
Until then there are several workaround options for configuring CUPS 1.2 to work with JDK:
1. System-wide #1: Add an /etc/cups/client.conf file with a "ServerName localhost" line. This will make the CUPS API library prefer localhost as the server to report
2. System-wide #2:
# Listen /var/run/cups/cups.sock
Listen localhost:631
sh /etc/init.d/cups restart
3. Per-user workaround #1 Add a ~/.cups/client.conf file with a "ServerName localhost" line. This will make the CUPS API library prefer localhost as the server to report
4. Per-user workaround #2 Set the CUPS_SERVER environment variable to localhost so that the CUPS API library will use and report that : CUPS_SERVER=localhost; export CUPS_SERVER
This approach could if necessary be set only in the environment in which your Java printing application is run and its effects confined to that.
There is one additional step to the workaround for at least some systems. JDK looks for "libcups.so". This is usually a symlink to the specific version, e.g. "libcups.so.2", but on systems without a developer package it may not exist. The solution is to locate the cups library on your system and if necessary create a symbolic link. For example:
cd /usr/lib ln -s libcups.so.2 libcups.soListing
Hello,
I have the same problem, but I am not using a local cups server. My /etc/cups/client.confconsists only of the line
ServerName cups.xx.xxx.xx
Therefor it should be used over IP I think. Is there anything I can do?
tschau
Sascha Effert
hello, i still can't print my java programs (netbeans, ireport), the printer status always show stopped: job-stopped, and nothing happens...and beside, the properties button on print dialog always disabled, please help,
i'm using ubuntu edgy, cups 1.2.4, and java 1.6.0
faizal Reply