4 Replies Latest reply on Jul 16, 2003 5:38 AM by Jason Cunningham

    set methods not called in SAR file

    Jason Cunningham Newbie

      Hi all,

      Right then...I'm stuck ;o(

      I've been trying to get a small application running that will start up when jboss does - not exactly rocket science I hear you all cry. Well, I didn't think so either. I won't bore you with the whole story...suffice it to say this has kept me stumped for quite a while now.

      I've boiled the problem down to the following. I've got a TestMBean (Interface) and a Test class. Here they are:

      package com.soe.mbeans;

      public interface TestMBean {
      public void setString(String aString);
      public String getString();
      public void start() throws Exception;
      public void stop() throws Exception;

      package com.soe.mbeans;

      public class Test implements TestMBean {

      private String aString;

      private boolean started = false;

      public void setString(String aString) {
      System.out.println("Got " + aString);
      this.aString = aString;

      public String getString() {
      return aString;

      public void start() throws Exception {
      started = true;
      System.out.println("I have started");

      public void stop() throws Exception {
      started = false;
      System.out.println("I've stopped");

      And my jboss-service.xml looks like this:

      Mamma Mia

      (Note: I've bunged in the 'depends' to try and postpone execution of the SAR as long as possible)

      If I deploy this SAR with JBoss already started, I get what I expect - two messages in the log, the first saying "Got Mamma Mia" and the second saying "I have started". However, if I start JBoss with the SAR in the deploy directory, I only get one message "I have started". The 'setString' method is not called.

      Any ideas why this is the case?

      Thanks for any advice and ideas! All welcome ;O)


      By the way, I'm using Jboss 3.0.3 with tomcat-4.1.12.