Java services stop working when user logs out

Solution 1:

You need to add the -Xrs flag to your java.exe command line to prevent the JVM from exiting when you log off an XP machine. The problem doesn't arise on Windows 7 (or Vista/Server 2008) because "Session 0 Isolation" prevents users from logging in (and thus logging off) Session 0, the place where services are run.

Be warned though -- if your java application catches shutdown events these may not be fired as expected when you use the -Xrs flag. Is that an issue for you?