4 Replies Latest reply on Jul 7, 2006 5:09 AM by matabo

    "GMS: address is..." dispalayed twice

    matabo

      I'm running Jbosscache inside WebLogic 7; I have two Weblogic instance and I reoplicate a state between them.

      When I start, even ONLY ONE Weblogic instance, I see the following lines displayed:

      -------------------------------------------------------
      GMS: address is 1.5.28.121:4875
      -------------------------------------------------------

      -------------------------------------------------------
      GMS: address is 1.5.28.121:4879
      -------------------------------------------------------

      i.e. I see TWO GMS lines (1.5.28.121 is the address specificated in the JBossCache config file).

      The piece of code is:

      private RepositoryDenormalizzato()
      {
      try {
      connTokenMonitorTree = new TreeCache();
      PropertyConfigurator config = new PropertyConfigurator();
      config.configure(connTokenMonitorTree, "META-INF/mioreplSync-service.xml");
      connTokenMonitorTree.setClusterName("conntokenmonitor");
      connTokenMonitorTree.startService();
      Ascoltatore asc = new Ascoltatore();
      connTokenMonitorTree.addTreeCacheListener(asc);
      }
      catch (Exception e) {
      System.out.println("ECCEZIONE impossibile attivare cluster "+e);
      e.printStackTrace();
      }
      }

      and this method is the constructor of a Singleton class.

      When I run the same code as a stand alone program outside Weblogic, the GMS line is displayed once.

      Of course, in WebLogic, the TreeCacheListener sees all events as "doubled". I.e., when I create a node, method "nodeCreated" is executed twice. When I remove a node, method "nodeRemoved" is executed twice, and so on.

      Why this happens?

      TIA
      matabo

        • 1. Re:
          belaban

          You apparently run another cluster, for a total of 2 in your WL instance

          • 2. Re:
            matabo

            Maybe you're right, but then I ask you: what you mean with "another cluster"?

            XML configuration file is the same in the two cases (stand alone program and "inside Weblogic" program), and in my code I've one only "startService()" invocation...

            Maybe constructor method of the singleton is invoked twice (unlikely...); do you mean that?

            regards
            matabo

            • 3. Re:
              belaban

              There are 2 JChannel.connect() calls, can you set a breakpoint in JChannel.connect() (get the JGroups src) ? Then you could look at the call stack and see *where* the connect() methods are called.

              • 4. Re:
                matabo

                Sorry, you were right.

                The code inside the constructor is executed twice. My mistake.

                regards
                matabo