This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I want to have a program run in the background of Windows NT and perform some functions at certain scheduled times during the day. From reading other posts I've settled on using the Java Service Wrapper from Tanuki Software.
To make sure I understand how this works, I wrote a simple program that uses Timer and TimerTask to display a message on a JFrame every 5 minutes.
The program works in JAVA. I also followed the directions on the Tanuki website and can get the program to work using the wrapper in console mode. I can even install and start the program as a windows service. However, once I start it in services mode nothing happens. No message ever displays.
Any idea what could be going on? Unfortunately there are no error messages to give clues, and when I check the services menu in the Applications folder of the Control Panel, everything looks good.
I'm not a GUI programmer so this is just a guess but as services are designed to run as soon as a machine boots up - even before anyone logs in, I would be surprised if you could include a GUI in a wrapped program - where would you expect a JFrame to open if there is nobody logged in and hence no desktop ?
Unless someone comes up with another suggestion, I'd try taking out the JFrame and just writing the messages to a file to start with.
Joined: Aug 03, 2008
Joanne, thank you. Writing to a text file does indeed work!
I don't understand the explanation, though. If I boot up at say 8:00 a.m. and my JAVA scheduler is set to display the GUI at 12:00 p.m., at which point I am still logged on, then why wouldn't it display the JFrame then?
Hi, I may be wrong.. but we use service wrapper for silent processes like backups, or some update Jobs. when i had configured service which is written in java it was working fine. It was just processing of some code and updates to database.
Try windows scheduled process batch files to open program and add condition if user is logged in. It may work.