I have a batch file that starts a Java process in a Windows 2003 server. As per the security policy, the users of that machine are logged off forcefully, if the user is inac
I'm using Java Service Wrapper to start the java process as windows service. I guess it works similary to the srvany.exe mentioned in the previous posting.
As per my analysis,
The Idle Solution will be writing a VC++ (.net) Windows Service creation program to launch the .bat / .exe as a System service with all the required call back methods to SCM.
Note : 1. Wrapping the process with srvany.exe would not work as it does not have any call back process to the SCM (Service Control Manager). 2. And java service Wrapper is a third party API (many are LGPL licensed).
If you want it to run under Scheduled tasks you have to make sure you don't have "only run when user logged in" checked, which usually means you need to supply a password.
A windows service would be the normal way to do this: the Java service wrapper is 3rd party but loads of people use it.
If you really wanted to not use a 3rd party method you could use svrany.exe (http://support.microsoft.com/kb/137890) on WIndows NT or later, but it is not designed specifically for Java.
Wrapping the process with srvany.exe and launching as a service would work as well.
http://support.microsoft.com/kb/137890
I don't know it this is relevant but we are using a flag to the jvm so it does not shutdown on logoffs
"java -Xrs"
Link to suns description of -Xrs