2 Replies Latest reply on Jul 16, 2002 1:00 AM by manish

    dynamic addtion/deletion of resources

    manish Newbie

      Hi,
      I am trying to develop a java client to Dynamically add / delete resources on the JBoss server.

      Is it possible to do this using the MBean Model ? If yes, please suggest the url where I can find the information or a code snippet would be of great help.

      One more question .. Will the information(data sources, security info etc...) given through the MBeans be persisted, so that I need not bind then agains whenever the server is restarted !!

      Thanks in advance,
      Manish.

        • 1. Re: dynamic addtion/deletion of resources
          marc fleury Master

          yes use MBeans for that,

          the information is persisted in the XML files you give it.

          take a look at the basic mbeans we ship with any default installation you can ship it as SAR, base XML you can even boot it on the network.

          To deploy a service, package it like the example and drop the file in the deploy directory remove it when you are done

          • 2. Re: dynamic addtion/deletion of resources
            manish Newbie

            Thanks for your reply,

            I had tried using the MBeans but no where in the documentation(3.0 quick start guide) did I find way to remotely access MBean.

            I tried using the following bit of code to start off with:



            javax.management.j2ee.ManagementHome home = (javax.management.j2ee.ManagementHome)context.lookup("ejb/mgmt/MEJB");

            javax.management.j2ee.Management remote = (javax.management.j2ee.Management)home.create();

            remote.getMBeanInfo(ObjectName objectname)


            And whenever I try to run it I get the following error
            java.lang.IllegalArgumentException: wrong number of arguments
            at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
            at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
            at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
            at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:128)

            Can anyone help me with the lookup and accessing part of the MBeans to bind data resources ?

            Thanks for your time,

            cheers,
            manish.