7 Replies Latest reply on Dec 20, 2005 6:36 PM by boercher

    Trailblazer JMX Service Objects

    echon

      Hi,

      i've got a (hope) small problem. I created a eclipse project and included
      all jars from /default/lib/ and from /default/deploy/ejb3.deployer.
      Like in the tutorial i added the annotations

      import org.jboss.annotation.ejb.Service;
      import org.jboss.annotation.ejb.Management;
      
      @Service(objectName = "dbis:service=UserService")
      @Management(UserService.class)
      public class UserServiceBean implements UserService { ...... }
      


      but eclipse says "the attribute value is undefined for the annotation type Management".
      I downloaded JBoss Source and saw the Management file is nearly empty.
      I searched in forum but only found the hint to install via packed archive and not via installer. I tried both, but always the same problem.

      Any hint for this problem? I would be happy about every answer.


      Regards

      Peter

        • 1. Re: Trailblazer JMX Service Objects
          echon

          well.. i think a lot of people would have tested this eample..

          Nobody has a solution??

          • 2. Re: Trailblazer JMX Service Objects
            echon

            no idea?

            • 3. Re: Trailblazer JMX Service Objects
              amwilliams

               

              "echon" wrote:
              well.. i think a lot of people would have tested this eample..

              Nobody has a solution??


              I've noticed the same thing. I think the annotations for JMX changed EJB Preview 3. I get the same error in Eclipse, but everything compiles fine through an ant script and works once deployed. Sorry I don't have any more insight than that.

              • 4. Re: Trailblazer JMX Service Objects
                echon

                is it possible to only mark the interface with @Management and implement it in the MBean?

                • 5. Re: Trailblazer JMX Service Objects
                  knifegun

                  Here is what I did. I created three classes (1. Management intetrface, 2. MBean interface 3. MBean implementation) shown below. I was able to deploy the MBean and access it via the following code. Hope this helps.

                  CONTEXT_PROPERTIES = new Properties();
                  CONTEXT_PROPERTIES.setProperty("java.naming.factory.initial",
                  "org.jnp.interfaces.NamingContextFactory");
                  CONTEXT_PROPERTIES.setProperty("java.naming.factory.url.pkgs",
                  "org.jboss.naming:org.jnp.interfaces");
                  CONTEXT_PROPERTIES.setProperty("java.naming.provider.url",
                  mServer);

                  InitialContext ctx = new InitialContext(CONTEXT_PROPERTIES);
                  mTelnetSession = (TelnetSession)ctx.lookup(TelnetSession.class.getName());



                  ---------- 1 ---------------

                  package com.xxxx.ejb;

                  import org.jboss.annotation.ejb.Management;

                  @Management()
                  public interface TelnetSessionManagement {


                  public void create() throws Exception;
                  public void start() throws Exception;
                  public void stop();
                  public void destroy();
                  }

                  ---------- 2 ---------------

                  package com.xxxx.ejb;

                  public interface TelnetSession {

                  ...
                  }

                  ---------- 3 ---------------
                  package com.xxxx.ejb;


                  import javax.ejb.*;

                  import org.jboss.annotation.ejb.RemoteBinding;
                  import org.jboss.annotation.ejb.Service;
                  import org.jboss.annotation.ejb.Management;
                  import org.jboss.system.ServiceMBeanSupport;

                  @Service(objectName="telnet:service=telnetservice")
                  @Remote(TelnetSession.class)
                  public class TelnetSessionMBean extends ServiceMBeanSupport implements TelnetSession, TelnetSessionManagement {

                  ....
                  }

                  • 6. Re: Trailblazer JMX Service Objects
                    echon

                    thx

                    • 7. Re: Trailblazer JMX Service Objects

                      I had the same problem. I downloaded two versions of jboss-annotation.jar (both tagged jboss-4.0.3SP1), one build on 2005-10-23 requiring Management to have a value and one of 2005-10-07 which does not. With the more recent version I annotate the interface and the bean with the other.

                      The management interface seems to be quite instable yet. See the history of Management.java at
                      http://anoncvs.forge.jboss.com/viewrep/JBoss/jboss-ejb3/src/main/org/jboss/annotation/ejb/Management.java

                      Branch HEAD
                      1.7 2005-11-08 value optinal
                      1.2 2005-09-27 value required
                      1.1 2005-05-31 no value

                      Branch Branch_4_0
                      1.1.2.4 2005-10-06 value required
                      1.1.2.1 2005-06-19 no value

                      so the future seems to be an optional value...