4 Replies Latest reply on Oct 13, 2005 4:27 PM by andrewi

    Mbean examples

    andrewi

      hi,

      i can't get access to my mbean which is running. Can anyone point me to some example code coz what I have found so far hasn't helped.

      thanks

        • 1. Re: Mbean examples
          darranl
          • 2. Re: Mbean examples
            andrewi

            I am still missing something. I have a simple MBean to pass a value back to the EJB. I'm using JB 4.0.2.

            For instance I follow the trailblazer example and I get

            Exception in thread "main" java.util.NoSuchElementException
            at java.util.AbstractList$Itr.next(Unknown Source)
            at org.jboss.mx.util.MBeanServerLocator.locate(MBeanServerLocator.java:67)
            at org.jboss.mx.util.MBeanServerLocator.locate(MBeanServerLocator.java:80)
            at client.XMLClient.main(XMLClient.java:52)


            I am hot deploying and know the mbean is started.

            Please help as I am getting absolutely nowhere.

            thanks

            • 3. Re: Mbean examples
              darranl

              Post the code you are executing.

              • 4. Re: Mbean examples
                andrewi

                the following snippets are based on the Jboss trailblazer


                MBeanServer server = MBeanServerLocator.locate();
                
                 jfrman = (jfrManager) MBeanProxyExt.create(
                 jfrManager.class, "jfr:service=manager", server);
                
                


                @Service (objectName="jfr:service=manager")
                public class jfrManager implements jfrManagerMBean{
                 private boolean started;
                


                @Management
                public interface jfrManagerMBean {
                 public void start() throws Exception;
                 public void stop () throws Exception;