2 Replies Latest reply on Jan 6, 2006 12:25 PM by mercuzio

    cannot fork a thread from a Servlet

    mercuzio Newbie

      I have a simple startup servlet (StartupServlet) that is executed at startup and should fork a thread to print a simple line every two seconds.
      When I start the application, the line is printed only once and I get the following error:

      Could anyone help?
      I don't understand why clustering is involved when all I would like to do is fork a thread ...

      Thanks
      Fred

      ...
      public class StartupServlet implements Servlet {
      public void init(ServletConfig config) {
      PollDBFeeds pdbf = new PollDBFeeds();
      pdbf.run();
      }

      ...

      ...
      public class PollDBFeeds extends Thread {

      public void run() {
      System.out.println("Hello world!");
      try {
      sleep(2000);
      } catch (InterruptedException ie) {}
      }

      ...

      Output:
      ...
      01:03:27,671 INFO [STDOUT] Hello world!
      01:03:29,765 INFO [JBossCacheManager] init(): replicationGranularity_ is 0 and invaldateSessionPolicy is 2
      01:03:29,796 ERROR [JBossCacheManager] JBossCacheService to Tomcat clustering not found
      01:03:29,796 ERROR [TomcatDeployer] Failed to setup clustering, clustering disabled


      ...