This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Tomcat and the fly likes  LookupPrintServices does not return network printers only local Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark " LookupPrintServices does not return network printers only local" Watch " LookupPrintServices does not return network printers only local" New topic
Author

LookupPrintServices does not return network printers only local

Michael Sideln
Greenhorn

Joined: Sep 01, 2006
Posts: 5
I have a web application that runs perfectly on oc4j - all network/local printers are detected and I can submit jobs over there, but when I deployed the same WAR on Tomcat 7, the PrintServiceLookup.lookupPrintServices retrieves only the local printers. The application runs on Windows. I think there is a problem with the permissions/Tomcat settings. Any idea what should be fixed?

Thank you in advance
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19685
    
  20

The printers are probably only available for your user account, not for the account that Tomcat runs as. Try changing the latter (from the Services screen) to see if that works. If so, you should create a separate user for Tomcat, log in as the user and install the printers, then let Tomcat run as that user.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Michael Sideln
Greenhorn

Joined: Sep 01, 2006
Posts: 5
Rob, thank you very much for your timely, informative response. I am trying to fix it now.
Michael Sideln
Greenhorn

Joined: Sep 01, 2006
Posts: 5
Rob,
This Tomcat server is installed and running on my PC, Windows OS.
So as you recommended I choose the "This account" option on the Services screen, "Log On" tab and entered my Windows network account credentials and started the service. The result was the same - only local printers but no network printers are found.
About the other option that you mentioned above - "you should create a separate user for Tomcat, log in as the user and install the printers, then let Tomcat run as that user." - how to install these network based printers on my local Tomcat server ?
Thank you,

Michael
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19685
    
  20

Well, since the network printers don't work under your account, I doubt they would work under a separate account.
Michael Sideln
Greenhorn

Joined: Sep 01, 2006
Posts: 5
Rob,
But why this WAR works/recognize network printers when deployed on oc4j ?
Thank you,
Michael
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19685
    
  20

To be honest, I have no idea...
 
wood burning stoves
 
subject: LookupPrintServices does not return network printers only local