Caldarale, Charles R wrote:
From: Tan Raymond [mailto:hexad...@yahoo.com.sg]
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: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org