tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Unsuccessful printing from Servlet‏
Date Sun, 11 Jan 2009 22:51:26 GMT
Caldarale, Charles R wrote:
>> From: Tan Raymond []
>> Subject: Unsuccessful printing from Servlet‏
>> PrintServiceLookup.lookupDefaultPrintService();
>> It return a null value.
> Are you running Tomcat as a Windows service?  Try running it with the startup.bat script
instead; services don't appear to have access to the PrintService.
> You'll need to use the .zip download rather than the .exe to get the scripts.

Not contradicting what Chuck says above, and despite my lack of precise 
knowledge about Vista, the reason may be as follows :
By default, when Tomcat is installed as a Windows Service, it runs under 
the user-id "LocalSystem".  That standard user has very wide privileges 
on the local machine, but no access to Windows "network services", among 
which is probably the print service.
You can change the user under which the Tomcat service runs, using the 
"My Computer" .. Manage .. Services .. applet.
If you are in a Windows Domain, you will need a valid Domain user, 
otherwise just create a local user "tomcat", and use it to run Tomcat as 
a Service.  It will then probably have access to the print service.
If you run Tomcat from the command-line, as Chuck indicates above, it 
will run in a console (not as a service), under your own login user-id.
That will also do the trick, but if you close the command window or log 
off, Tomcat will stop.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message