monesseldeur wrote:
[...]

Ok, stop banging your head for a moment, get a cup of coffee, relax, and let's do this systematically. The wisdom is in the lotus.

I am no great Tomcat expert, but there are some practical things I know about running services under Windows.

First, have a look at the Windows Event logs, just in case there is some message there that you missed.
None ? Sure ?
Then let's continue.

Second, unless you check a particular checkbox in your service, a service does not have access to the desktop, so if you try to run a graphic program as a test (Notepad, Calculator etc.. like you did), from a program running as a service, you will not see anything. The same if the program in question requires a keyboard input, or pops up a message dialog.

Try a little bat file like you did, which just writes to a file in c:/temp. Or make your command in Java one that does only that, like
echo "it works !" > c:/temp/itworks.txt
(quote this appropriately)

Does that work ?

Next, the "LocalSystem" user, which is normally selected by default when you install a service, does not have access at all to any Windows network functions. It cannot access network drives, printers etc.. With other users, your mileage may vary. If your station is part of a domain, you will need to use a domain user to be able to do these things. And the domain user must be one that has access to whatever resource you are trying to use. As Chuck said, if the user can print but not access the network resource you are trying to access, you're not going to get anywhere. (But you should have gotten an error in the Event log).

One other possible case is that your background program, because it is the first time it runs under that user, is popping up his initial "registration dialog" or "welcome new user popup screen". Know what I mean ? Well, without a console, it will be waiting forever for you to click the welcome message away. If it is anything like that, login as the user under which Tomcat should run, start the program first on the console, click all those annoying messages and tell them to never come back. Then close the program and call it up again, to make sure they don't. Loop as long as necessary.
Then try again from your service.

None of the above is specific to Tomcat by the way. It's the same for any program running as a Windows Service. I have never tried this with Java and/or Tomcat, but I have plenty of programs which run as Windows services and access network resources fine.

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

Reply via email to