activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Endre StĂžlsvik <Apa...@Stolsvik.com>
Subject AMQ JMX: register MBeans locally w/o starting MBeans server
Date Mon, 20 Nov 2006 09:16:26 GMT
Hi!

I'm trying to get ActiveMQ to register to the JVM's (1.6 rc) built-in 
"JMX server", w/o specifying the -D options to forcibly start the MBean 
server.

When I fire up jconsole (or jps), I can see the different java 
processing running on my box: the Eclipse instance, the JConsole itself, 
and my application, this w/o enabling any -Dcom.sun.management.jmxremote 
switches on any of them.
   I can for each of them go in and check MBeans for "JMImplementation", 
"com.sun.management", "java.lang" and "java.util.logging".
   (However, connecting "locally" to a JVM obviously starts up a remote 
JMX server nonetheless - which JConsole then connects to).

This is what I get:
   1) Using the config fragment A, not providing -D switches, I cannot 
get the ActiveMQ instance to register its MBeans (I can't get them up in 
the JConsole). There are a bunch of exceptions like X in the log, 
appearing while starting up, and while "working" (It seems to retry 
hooking up, or something).

   2) Using the same unmodified config fragment, but now providing the 
-Dcom.sun.management.jmxremote* bunch of switches, I do get the active 
mq MBeans up in the console along with the default stash.

   3) Using the same fragment, without -D options, but with 
createMBeanServer="true" doesn't help as opposed to 1) (gives same result).

   4) Using the same fragment A, but now with both 
createMBeanServer="true" and createConnector="true", gives me TWO 
"JMX'es" on the application JVM (AND invariably gives the Y exception): 
one of them is the same as '1' above, and the other one is apparently 
implemented using mx4j - obviously missing both the "java.lang" and 
"java.util.logging" MBean sets.
   (Btw, mx4j is now in version 3.0.1, as opposed to 2.1.1 as shipped 
with ActiveMQ (it is just the next release, though!)).


What I'd like, is to get '1' working "as '2'": not specifying any -D 
options to forcibly start the JMX server, but still be able to connect 
to it "locally" as you can with the default standard MBeans, and have 
ActiveMQ's MBeans available there along with the standard stuff. Is this 
impossible? If so, why, and can it be fixt by coding?


.. Additionally, it seems like if I hit the debugger (pause the entire 
application), the system goes down rather hard, and ends up going into a 
rather thight loop in the Producer giving the Z Exception.

Regards,
Endre

A:
<amq:broker id="PicorgMQ-id" brokerName="PicorgMQ"
     useJmx="true" persistent="true">
   <amq:managementContext>
     <amq:managementContext useMBeanServer="true"
       createMBeanServer="false"
       createConnector="false"
       jmxDomainName="picorg.messageQueue" />
   </amq:managementContext>
   ...
</amq:broker>


X:
14563 [ActiveMQ Transport: tcp:///127.0.0.1:5689] WARN 
org.apache.activemq.broker.jmx.ManagedRegionBroker  - Failed to register 
MBean: 
picorg.messageQueue:BrokerName=PicorgMQ,Type=Subscription,persistentMode=Non-Durable,destinationType=Topic,destinationName=topic_//ActiveMQ.Advisory.TempQueue_topic_//ActiveMQ.Advisory.TempTopic,clientId=ID_endrehome-5687-1164011376081-4_0,consumerId=ID_endrehome-5687-1164011376081-3_1_-1_1
14563 [ActiveMQ Transport: tcp:///127.0.0.1:5689] DEBUG 
org.apache.activemq.broker.jmx.ManagedRegionBroker  - Failure reason: 
java.lang.NullPointerException
java.lang.NullPointerException
	at 
org.apache.activemq.broker.jmx.ManagedRegionBroker.registerSubscription(ManagedRegionBroker.java:302)
	at 
org.apache.activemq.broker.jmx.ManagedRegionBroker.registerSubscription(ManagedRegionBroker.java:211)
	at 
org.apache.activemq.broker.jmx.ManagedTopicRegion.createSubscription(ManagedTopicRegion.java:45)
	at 
org.apache.activemq.broker.region.AbstractRegion.addConsumer(AbstractRegion.java:201)
	at 
org.apache.activemq.broker.region.TopicRegion.addConsumer(TopicRegion.java:110)
	at 
org.apache.activemq.broker.region.RegionBroker.addConsumer(RegionBroker.java:331)
	at 
org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:86)
	at 
org.apache.activemq.advisory.AdvisoryBroker.addConsumer(AdvisoryBroker.java:78)
	at 
org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:86)
	at 
org.apache.activemq.broker.MutableBrokerFilter.addConsumer(MutableBrokerFilter.java:96)
	at 
org.apache.activemq.broker.TransportConnection.processAddConsumer(TransportConnection.java:568)
	at org.apache.activemq.command.ConsumerInfo.visit(ConsumerInfo.java:313)
	at 
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:284)
	at 
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:177)
	at 
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:65)
	at 
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:133)
	at 
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:122)
	at 
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
	at 
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:137)
	at java.lang.Thread.run(Thread.java:619)

Y:
5781 [main] DEBUG 
org.springframework.beans.factory.support.DefaultListableBeanFactory  - 
Invoking BeanPostProcessors before initialization of bean 'PicorgMQ-id'
5781 [main] DEBUG 
org.springframework.beans.factory.support.DefaultListableBeanFactory  - 
Invoking afterPropertiesSet() on bean with name 'PicorgMQ-id'
5922 [main] DEBUG org.apache.activemq.broker.jmx.ManagementContext  - 
Failed to create local registry
java.rmi.server.ExportException: internal error: ObjID already in use
	at sun.rmi.transport.ObjectTable.putTarget(ObjectTable.java:169)
	at sun.rmi.transport.Transport.exportObject(Transport.java:74)
	at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:229)
	at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:393)
	at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:129)
	at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:190)
	at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:92)
	at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:78)
	at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:186)
	at 
org.apache.activemq.broker.jmx.ManagementContext.createConnector(ManagementContext.java:382)
	at 
org.apache.activemq.broker.jmx.ManagementContext.findMBeanServer(ManagementContext.java:301)
	at 
org.apache.activemq.broker.jmx.ManagementContext.getMBeanServer(ManagementContext.java:154)
	at 
org.apache.activemq.broker.jmx.ManagementContext.start(ManagementContext.java:78)
	at org.apache.activemq.broker.BrokerService.start(BrokerService.java:391)
	at 
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:47)
	at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1062)
	at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1029)
	at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:420)
	at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
...

Z:
522640 [ENDRE:TESTING:Consumer] DEBUG com.picorg.experiment.mq.Producer 
  - Starting consumption!
522640 [ENDRE:TESTING:Consumer] ERROR com.picorg.experiment.mq.Producer 
  - Got Exception while consuming.
org.apache.activemq.ConnectionFailedException: The JMS connection has 
failed: Channel was inactive for too long.
	at 
org.apache.activemq.ActiveMQConnection.checkClosedOrFailed(ActiveMQConnection.java:1230)
	at 
org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:273)
	at com.picorg.experiment.mq.Consumer.consumeMessage(Consumer.java:82)
	at com.picorg.experiment.mq.Consumer$1.run(Consumer.java:60)
	at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.activemq.transport.InactivityIOException: Channel 
was inactive for too long.
	at 
org.apache.activemq.transport.InactivityMonitor.readCheck(InactivityMonitor.java:101)
	at 
org.apache.activemq.transport.InactivityMonitor.access$000(InactivityMonitor.java:35)
	at 
org.apache.activemq.transport.InactivityMonitor$1.run(InactivityMonitor.java:51)
	at 
edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:431)
	at 
edu.emory.mathcs.backport.java.util.concurrent.FutureTask.runAndReset(FutureTask.java:198)
	at 
edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:189)
	at 
edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:213)
	at 
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at 
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
	... 1 more

Mime
View raw message