3 Replies Latest reply on Feb 20, 2012 12:02 PM by npereira

    TaskClient threads not closing

    npereira Newbie

      Hi forum,

       

      I have a question that you might help me with.

      I have a piece of code where I connect to the TaskClient and get the tasklist from it.

       

      At this point I see that in order to connect to the TaskServer, it has created two threads (NioProcessor-1 and pool-2-thread-1).

       

      But so far everything is working until this point.

       

      The problem comes when I try to disconnect from the taskClient and MinaTaskServer. The fact is that these two thread do not close and the application continues to run (although not executing anymore code).

       

      I have attached the java file.

      If anybody could help me I would appreciate it.

       

      Regards,

      npereira

        • 1. Re: TaskClient threads not closing
          zhujinwei Newbie

          I do not understand it ,too. Hope someone could explain the reason.

          • 2. Re: TaskClient threads not closing
            npereira Newbie

            Hi forum,

             

            Following up on this matter, I have some more info.

             

            The fact is that eventually the program stops running, but this only happens about 30 to 60 seconds after the last instruction in the code was run.

             

            Alternatively, I tried the return instruction which had the same outcome. The only one that did the job was System.exit(0);

             

            So would like to ask if using the System.exit is the best approach or should I file a bug?

            Would really appreciate the help on this matter.

            • 3. Re: TaskClient threads not closing
              npereira Newbie

              Hi forum,

               

              Finally figured what was causing the problem.

              After downloading the jbpm code was able to figure out that there was a problem with the MinaTaskClientConnector class in the disconnect method.

               

              The connector variable  was not being disposed and that's why not closing the socket thread.

              So created a Jira issue and posted a fix, lets hope it gets integrated with the main project.

               

              Regards,

              npereira