[ 
https://issues.apache.org/jira/browse/AMQ-9711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17953883#comment-17953883
 ] 

Jean-Baptiste Onofré commented on AMQ-9711:
-------------------------------------------

Instead of using the jmx configuration as argument, did you try this in the 
activemq.xml:
{code:java}
<managementContext>
  <managementContext createConnector="true" connectorPort="15090" />
</managementContext>{code}
Your code is also not correct: there's no destination on a slave because the 
slave doesn't start the transport connector, the store, etc. Slave just starts 
the broker directly waiting for the lock (no transport connector, no network 
connector, nothing, just broker).

So, in your code, you should just connect to the slave broker with 

{{}}
{code:java}
ObjectName mbeanName = new 
ObjectName("org.apache.activemq:type=Broker,brokerName=localhost");{code}
{{}}

On the Broker MBean, you can get the "Slave" attribute (that will be true for a 
slave broker), and that's it.

> Cannot create MBean on ActiveMQ slave broker
> --------------------------------------------
>
>                 Key: AMQ-9711
>                 URL: https://issues.apache.org/jira/browse/AMQ-9711
>             Project: ActiveMQ Classic
>          Issue Type: Bug
>    Affects Versions: 5.16.2
>            Reporter: Diptesh Chakraborty
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>
> I have ActiveMQ in master slave mode with KahaDB shared across common file 
> system.
> I am encountering 
> {color:#FF0000}*javax.management.InstanceNotFoundException*{color}
> {code:java}
> String jmxUrl1 = "service:jmx:rmi:///jndi/rmi://" + remoteIp1 + 
> ":15090/jmxrmi"; 
> String brokerName1 = "slave";
> JMXServiceURL url1 = new JMXServiceURL(jmxUrl1);
> JMXConnector jmxConnector = JMXConnectorFactory.connect(url1, null);
> MBeanServerConnection connection = jmxConnector.getMBeanServerConnection();
> ObjectName queueObjectName1 = new ObjectName(
>                 "org.apache.activemq:type=Broker,brokerName=" + brokerName1 + 
> ",destinationType=Queue,destinationName=TestIn"
>         );{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to