Hi,
during my works at the SkyJUMP print code, i encountered a problem. On
my Ubuntu 12.04 box i get the message "Printer not found". The problem
only occurs, if i set a JobName attribute to the PrintServiceLookup.
This is the default in the actual code. Without a JobName attribute i
get all my printservices (printers).
I've attached a small test class. Please can anybody platforms run this?
There are two tests. The first is without a JobName attribute and the
second one is with a JobName attribute. The class makes only a lookup
for printers. Nothing is printed.
I mean, this may be a (Debian/Ubuntu) Linux bug in Java.
Thanks
Matthias
--
_ __ ___ _________________________________ ___ __ _
W http://www.openjump.de
_ __ ___ _________________________________ ___ __ _
import javax.print.DocFlavor;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.JobName;
public class PSLTest {
public static void main(String[] args) {
System.out.println("PrintServiceLookup Test without JobName ...");
DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
PrintRequestAttributeSet attributeSet = new HashPrintRequestAttributeSet();
System.out.println("attributeSet.size(): " + attributeSet.size());
PrintService[] services = PrintServiceLookup.lookupPrintServices(flavor, attributeSet);
System.out.println("services.length: " + services.length);
for (PrintService printService : services) {
System.out.print(printService.getName() + ", ");
}
System.out.println("\n\nPrintServiceLookup Test with JobName ...");
attributeSet.add(new JobName("testjobname", null));
System.out.println("attributeSet.size(): " + attributeSet.size());
services = PrintServiceLookup.lookupPrintServices(flavor, attributeSet);
System.out.println("services.length: " + services.length);
for (PrintService printService : services) {
System.out.print(printService.getName() + ", ");
}
System.out.println("\n\ndefault: " + PrintServiceLookup.lookupDefaultPrintService().getName());
}
}
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel