My Oracle Support Banner

Web Service Using PrintServiceLookup Returns Less Printers (Doc ID 2175559.1)

Last updated on APRIL 06, 2018

Applies to:

Oracle WebLogic Server - Version 12.1.3.0.0 to 12.1.3.0.0 [Release 12c]
Information in this document applies to any platform.

Symptoms

Customer has written a Web Service in Java (a .war file)

The Web Service uses the Java PrintServiceLookup.lookupPrintServices() API to get a list of printers.

When the war is deployed to a two-nodes environment, the Web Service is not returning the expected printer list.

Java code executed from Unix prompt got a list of 293 printers. However, the same code executed from the Java Web Service returned only 124. Somehow the list is getting cut out.

Here is the code:

import javax.print.PrintService;
import javax.print.PrintServiceLookup;

public class GetPrinters
{
public static void main (String [] args)
{
System.out.println(System.getProperty("java.version"));
PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null);
System.out.println("Number of print services: " + printServices.length);

for (PrintService printer : printServices)
System.out.println("Printer: " + printer.getName());
}
}

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.