Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 642 invoked from network); 11 Jan 2009 22:56:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jan 2009 22:56:08 -0000 Received: (qmail 40939 invoked by uid 500); 11 Jan 2009 22:55:55 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 40914 invoked by uid 500); 11 Jan 2009 22:55:55 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 40903 invoked by uid 99); 11 Jan 2009 22:55:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Jan 2009 14:55:55 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [212.85.38.174] (HELO popeye.combios.es) (212.85.38.174) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Jan 2009 22:55:46 +0000 Received: from [192.168.245.129] (p549EB219.dip0.t-ipconnect.de [84.158.178.25]) (authenticated bits=0) by popeye.combios.es (8.13.8/8.13.8/Debian-3) with ESMTP id n0BMtJ5a021083 for ; Sun, 11 Jan 2009 23:55:24 +0100 Message-ID: <496A77EE.6090505@ice-sa.com> Date: Sun, 11 Jan 2009 23:51:26 +0100 From: =?UTF-8?B?QW5kcsOpIFdhcm5pZXI=?= User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Unsuccessful printing from =?UTF-8?B?U2VydmxldOKAjw==?= References: <711070.2618.qm@web76302.mail.sg1.yahoo.com> <0AAE5AB84B013E45A7B61CB66943C17215A8347E55@USEA-EXCH7.na.uis.unisys.com> In-Reply-To: <0AAE5AB84B013E45A7B61CB66943C17215A8347E55@USEA-EXCH7.na.uis.unisys.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.92.1/8852/Sun Jan 11 20:31:01 2009 on popeye.combios.es X-Virus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org Caldarale, Charles R wrote: >> From: Tan Raymond [mailto:hexadome@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-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org