Using Ruby on Rails on Tomcat, I want to sent a file to a printer, which
should be easy via a system command. It works if I run Tomcat from the
command line, but not if Tomcat is running as a service.

Some details...

I am using Tomcat 6 on Windows Server 2003, Rail 2.3.9, JRuby 1.5.2 (I
appreciate most people around here will not be familar with Ruby on Rails,
but I think this is a Tomcat problem, not a RoR problem). I am trying to
deploy an application in which records can be printed to a label printer. To
print, it creates a new file, which is then copied to lpt4: (which is
actually a USB port on a networked computer, via "net use") with a system
command:
"copy C:\tomcat-6\webapps\print\WEB-INF\print.txt lpt4"

This works fine in development (using Webrick as the web server), but I
found it does not work when I try to deploy to production (i.e., using
Tomcat on the same physical machine). The message returned from the OS is "0
file(s) copied", nothing more helpful than that. The command looks fine, and
indeed, I can copy the command and paste it into the command prompt, and the
label is spat out. Clearly the file is being created and saved properly, and
the file is formatted okay for the printer to understand.

However, when I run Tomcat from the command prompt ("tomcat6"), it does work
(and this is using the same Tomcat installation, by the way).

My first guess was a permissions issue, so I had the Tomcat service using
the admin account, but still nothing.

Anyone any suggestions for what the problem might be? At this stage, I am
not even sure where to look.
-- 
View this message in context: 
http://old.nabble.com/Printing-using-system-commands-from-Tomcat-as-a-service-tp29942098p29942098.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to