4 Replies Latest reply on Oct 3, 2006 12:14 AM by Brian Stansberry

    Need help trying to expose singleton mbean interface to all

    Mark French Newbie

      Hi,

      I currently have an mbean deployed in the deploy-hasingleton directory which I need to have its interface accessible via jndi to all nodes. The following is it's related deployment descriptor:

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
       <mbean
       code="com.transtoll.modules.eventmanager.management.EventContainer" name="eventmanager:service=eventcontainer">
       </mbean>
      
      
       <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
       name="jboss.jmx:type=adaptor,name=HASingletonEventContainerInvoker,protocol=jrmp,service=proxyFactory">
       <depends optional-attribute-name="InvokerName">
       jboss:service=invoker,type=pooled
       </depends>
       <depends optional-attribute-name="TargetName">
       eventmanager:service=eventcontainer
       </depends>
       <attribute name="JndiName">HASingletonEventContainer</attribute>
       <attribute name="InvokeTargetMethod">true</attribute>
       <attribute name="ExportedInterfaces">
       com.transtoll.modules.eventmanager.management.EventContainerMBean
       </attribute>
       <attribute name="ClientInterceptors">
       <interceptors>
       <interceptor>
       org.jboss.proxy.ClientMethodInterceptor
       </interceptor>
       <interceptor>
       org.jboss.invocation.InvokerInterceptor
       </interceptor>
       </interceptors>
       </attribute>
       </mbean>
      </server>


      This bean based on the hajndi wiki page but for some reason the JNDI entry doesn't appear in any of the slave nodes. Is something wrong or is it not possible with jboss 4.0.4 and I have to use the RMIAdaptor and JMX calls?

      Cheers

      Mark

        • 1. Re: Need help trying to expose singleton mbean interface to
          Mark French Newbie

          Forgot to add the code and service descriptor is packaged in a sar and copied to the deploy-hasingleton directory if that make a difference.

          • 2. Re: Need help trying to expose singleton mbean interface to
            Brian Stansberry Master

            The bean proxy should be visible in the regular JNDI tree in the node on which it is deployed. Clients needing to access the proxy should use HA-JNDI to find it -- anything bound in the normal JNDI tree on any cluster node will be visible on all nodes via the HA-JNDI service.

            • 3. Re: Need help trying to expose singleton mbean interface to
              Mark French Newbie

              I have also configured the RMIAdaptor configured as a singleton so that the clustered queues etc can be flushed by any node in cluster. Why does it's jndi name appear in all the global jndi namespace on each node?

              • 4. Re: Need help trying to expose singleton mbean interface to
                Brian Stansberry Master

                Sorry for a very late reply; probably won't help you but may help others.

                HA-JNDI provides two functions:

                1) A global replicated tree. Objects bound into this tree (by a client that creates an InitialContext that connects to HA-JNDI) are replicated across the cluster and can be seen in the jmx-console's global jndi namespace on any node.

                2) An ability to query the regular, non-replicated jndi tree on any node in the cluster. Thus things bound on any one node can be looked up by connecting to the HA-JNDI server running on any node in the cluster. This is actually the more important function, but it's less intuitively understood. The jmx-console doesn't show objects accessible this way in the global jndi namespace. They only appear in jmx-console in the regular jndi namespace on the server(s) where they are bound. But this doesn't mean a client doing a lookup via HA-JNDI can't find them.

                Your RMIAdaptor is bound in local JNDI on the singleton master node, and thus isn't visible in the global jndi namespace. But it can be looked up via HA-JNDI.