Hi,
I'm having a problem understanding how the lifecycle works for running a java application as a service. I have a java program that works fine as a console application, but fails when installed as a service as it shuts down immediately after completing initialisation.
The issue seems to be that the main method thread sets up a whole set of new working threads and then lets itself die, which in turn seems to indicate to the service control panel that the application has died, so the JVM is killed and the server stops.
I have worked around this by putting a Thread.sleep(10000000); call in the initialisation thread which means the server stays up, can deal with requests and generally works fine. However in this case I can't stop the application via the service control panel as the request just times out and I get the 'did not respond in a timely fashion' error.
Love the product apart from this (and the folders in classpath issues i posted a coupl eof hours ago). Easy to use and surprisingly powerful.
cheers, Biff