4 Replies Latest reply: Apr 25, 2007 6:38 AM by 796534 RSS

    Process started with javaw killed after logout on Windows Server 2003

    796534
      Hi All

      Guess this question repeatedly pops up (based on Google hits anyway). But I can't find any satisfactory solution to the problem of starting up a Java app as a server on Windows - in other words to keep the app running even after I log out of the Windows Server environment (typically log in using Windows Remote Desktop).

      The process runs for exactly 30 minutes after logout and then dies (in spite of using the -Xrs option and without invoking my shutdown hook).

      What's the best way to start a Java app on Windows when it has to run as a server? (Most responses seem to present the C wrapper & Service solution but surely as a mature language, Java must have a better way of doing this???)

      Help much appreciated
      Lance
        • 1. Re: Process started with javaw killed after logout on Windows Server 2003
          807606
          What's the best way to start a Java app on Windows
          when it has to run as a server? (Most responses seem
          to present the C wrapper & Service solution but
          surely as a mature language, Java must have a better
          way of doing this???)
          a better way than being run as a service? like what? what's wrong with wrapping it as a service? that's exactly what you want. it's a platform-neutral language, remember. for it to explicitly include windows service code would be anathema to that
          • 2. Re: Process started with javaw killed after logout on Windows Server 2003
            807606
            I have a similar dilemma:

            Product called "Exstream Dialogue" runs a real-time engine. The engine is an executable, apparently written in C++. The engine has a client connection to a JMS queue. (Sonic)

            The engine is started via batch script. I have tried running the script as a scheduled task or as a system service. Either way, when someone logs on and off the server using: Dameware, VM Console, or the console, the engine gets killed. Remote Desktop Connection (log on and log off) does not cause the engine to get killed.

            I believe what is getting killed is the JMS connection, which drops the engine.

            Since RDC doesn't use the console (Dameware, VM C, and obviously the real console - use the console) it doesn't kill "ancillary" tasks.

            Tried writing a java "wrapper," which is started as a service, which then starts the engine. The wrapper doesn't get killed, but the engine still does - no surprise. Code was put in the wrapper to restart the engine if it "disappears." Hokey way to solve this problem.

            The question remains: how to prevent a running task (that has java ties) from being whacked by a console logoff?

            Vendors are useless - all point to the other components. (And all of them tell me to stop using VM Console and Dameware. Gee, thanks. Why don't you stop Niagra Falls while I fix an erosion problem...)
            • 3. Re: Process started with javaw killed after logout on Windows Server 2003
              807606
              If I do not want to install a process as a service I run it under windows as a scheduled task. That allows me to log out and the process will keep running.

              Andreas
              • 4. Re: Process started with javaw killed after logout on Windows Server 2003
                796534
                Hi Andreas

                Thanks for your replies. In the end I did resolve the issue by wrapping it (using Tanuki Software Java Service Wrapper) and have to admit found it very simple to do. My initial concern was with adding complexity but that's been eliminated.

                Thanks
                Lance