Link to home
Start Free TrialLog in
Avatar of madhurikg
madhurikg

asked on

How to find the available printers using java when the program is running in weblogic??

Hi,

      I need to find all available network lan printers which support given document flavor using java API.
     
      When i run the following code standalone, i am able to find the printers.
       PrintService[] mPrintServices = PrintServiceLookup.lookupPrintServices(aDocFlavor, aPrintRequestAttributeSet);
 
      But the same code when it is getting executed in weblogic environment by a message driven been it is not able to find all network lan printers except local printer.

       It is on the same windows machine.

       Do i need to configure anything in weblogic to make the printers visible to weblogic or should i have to disable any ports?

     ***This is urgent looking for suggestions***

Thanks
Avatar of girionis
girionis
Flag of Greece image

Hi madhurikg

How do you run the code in first place? Is it via a stand alone java application? Do you get a popup with the available printers? Bare in mind that EJBs are executred on the server and not on the client and therefore you might be getting all printers but you are not able to see them.

Cheers
Avatar of madhurikg
madhurikg

ASKER

I run the code by stand alone java application. I do not get any pop up windows. I just print all available printservices.
The following is the code.

PrintService[] mPrintServices = PrintServiceLookup.lookupPrintServices(aDocFlavor, aPrintRequestAttributeSet);
for (int i = 0; i < oPrintServices.length; i++) {
      lw.log("printservicename:::"+oPrintServices[i].getName());
}

If the same code is executed by the Message driven Bean(EJB) in weblogic it is not finding any lan printers

**looking for suggestions
ASKER CERTIFIED SOLUTION
Avatar of anumalas
anumalas

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial