5 Replies Latest reply on Mar 3, 2006 11:51 AM by genman

    hot deployment issue?

      Hi Folks,

      I have a singleton thread running in Jboss, and print some info in a loop.
      the code is in a .ear.
      then I changed the code, it will print differnt info

      then hot deploy, not shutting down jboss. I have found 2 threads are running, and print the previous and late info.

      Which means, when hot deploy, Jboss doesn't kill the previous thread?

      How to solve this issue?
      Thank you.

      chwang

        • 1. Re: hot deployment issue?
          starksm64

          You need to cleanup threads you create.

          • 2. Re: hot deployment issue?

            Thank you. Scott,

            How to clean up?
            I need to clean in the code, or set up in Jboss.

            Chwang

            • 3. Re: hot deployment issue?
              starksm64

              If you started the thread you need to stop it. What is the nature of the thread in question?

              • 4. Re: hot deployment issue?

                Hi, Scott,

                I use Singleton pattern for this thread. The thread is a commandManager, all different commands will go to the manager to be processed(command pattern). so there is a while loop to check if there are commands coming in the manager.

                in my mind, I thougt, when hot deploy, Jboss automatically kills all runnig threads first, then loads a new .ear, but it doesn't look like this way.

                I also did a simple test. after I started Jboss, and Jboss finished loading. the commandmanager was running. then I deleted the .ear. I found the thread was still running.

                Please help. Thank you.

                Chwang

                • 5. Re: hot deployment issue?
                  genman


                  You shouldn't use singletons, which is usually bad design. Create ServiceMBeans and in your stopService() shut down your thread.