activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Gale <paul.n.g...@gmail.com>
Subject Strange behavior with unregistering MBeans
Date Wed, 15 May 2013 20:29:58 GMT
Hi,

I've noticed some unexplained behavior when using the web-console in 5.8.0
to delete either topics or queues. This is NOT the infamous CSRF attack
question.

FYI: the credentials entered when accessing the web-console are the same as
those found in jmx.access/jmx.password.

Steps to reproduce. Using the web-console on a system that at startup has
no preexisting queues or topics:

   1. Use the Send tab to send a message to the TOPIC called foo.bar.
   SUCCEEDS.
   2. Use the Topics tab. Stats verified for foo.bar.
   3. Delete the topic foo.bar. SUCCEEDS.
   4. Reload the Topics tab. Verified that foo.bar no longer appears in
   list of topics.
   5. Use the Send tab to send a message to the TOPIC called foo.bar. FAILS
   (see exception below). Error screen displayed.
   6. Reload the Topics tab. Despite previous exception the foo.bar topic
   IS there indicating a successful send.

The same behavior is exhibited for both topics and queues.

This is the exception:

jvm 1    | Caused by: javax.management.InstanceNotFoundException:
org.apache.activemq:type=Broker,brokerName=ActiveMQ.Broker,destinationType=Topic,destinationName=foo.bar
jvm 1    |     at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1094)
jvm 1    |     at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:662)
jvm 1    |     at
com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:639)
jvm 1    |     at
javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:263)
jvm 1    |     ... 56 more

Immediately prior to the exception appearing I get the following line of
debug output (as I specified
log4j.logger.org.apache.activemq.broker.jmx=DEBUG inside log4j.properties):

jvm 1    | DEBUG | Unregistering MBean
org.apache.activemq:type=Broker,brokerName=darkhorse.onyx.ove.com
,destinationType=Topic,destinationName=foo.bar

So in that sense it's not surprising that the InstanceNotFoundException is
raised. However, what I don't understand is why the subsequent send after
destination deletion doesn't recreate the MBean and register it?

Any ideas as to why this is happening?

Thanks,
Paul
___________________________________________________________________

My activemq.xml config in effect is:

<?xml version="1.0" encoding="UTF-8"?>
<beans
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans.xsd
                        http://activemq.apache.org/schema/core

http://activemq.apache.org/schema/core/activemq-core.xsd
                        http://camel.apache.org/schema/spring

http://camel.apache.org/schema/spring/camel-spring.xsd">

  <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="ignoreUnresolvablePlaceholders" value="true"/>
    <property name="locations">
      <list>
        <value>file:${activemq.conf}/credentials.properties</value>
      </list>
    </property>
  </bean>

  <broker xmlns="http://activemq.apache.org/schema/core"
          id="theBroker"
          ioExceptionHandler="#ioExceptionHandler"
          useJmx="true"
          deleteAllMessagesOnStartup="true"
          advisorySupport="true"
          dedicatedTaskRunner="false"
          monitorConnectionSplits="true"
          brokerName="darkhorse.onyx.ove.com"
          dataDirectory="${activemq.data}"
          tmpDataDirectory="${activemq.data}/tmp_storage"
          schedulePeriodForDestinationPurge="60000"
          offlineDurableSubscriberTaskSchedule="3600000"
          offlineDurableSubscriberTimeout="86400000">

    <destinationPolicy>
      <policyMap>
        <policyEntries>
          <policyEntry topic="ActiveMQ.Advisory.>"
                       memoryLimit="2mb"
                       gcInactiveDestinations="false"/>
          <policyEntry topic=">"
                       memoryLimit="2mb"
                       maxPageSize="4000"
                       durableTopicPrefetch="100"
                       producerFlowControl="false"
                       advisoryWhenFull="true"
                       advisoryForFastProducers="true"
                       advisoryForSlowConsumers="true"
                       advisoryForDiscardingMessages="true"
                       prioritizedMessages="true"
                       doOptimzeMessageStorage="true"
                       gcInactiveDestinations="true"
                       inactiveTimoutBeforeGC="360000">
            <dispatchPolicy>
              <strictOrderDispatchPolicy/>
            </dispatchPolicy>
            <deadLetterStrategy>
              <individualDeadLetterStrategy topicPrefix="DLQ."
                                            processExpired="false"
                                            useQueueForTopicMessages="true"

destinationPerDurableSubscriber="false"/>
            </deadLetterStrategy>
            <pendingDurableSubscriberPolicy>
              <vmDurableCursor/>
            </pendingDurableSubscriberPolicy>
          </policyEntry>
          <policyEntry queue=">"
                       memoryLimit="2mb"
                       maxPageSize="4000"
                       queuePrefetch="100"
                       strictOrderDispatch="false"
                       producerFlowControl="false"
                       advisoryWhenFull="true"
                       advisoryForFastProducers="true"
                       advisoryForSlowConsumers="true"
                       optimizedDispatch="true"
                       prioritizedMessages="true"
                       doOptimzeMessageStorage="true"
                       gcInactiveDestinations="true"
                       inactiveTimoutBeforeGC="360000">
            <dispatchPolicy>
              <roundRobinDispatchPolicy/>
            </dispatchPolicy>
            <deadLetterStrategy>
              <individualDeadLetterStrategy queuePrefix="DLQ."
                                            processExpired="false"
                                            useQueueForQueueMessages="true"

destinationPerDurableSubscriber="false"/>
            </deadLetterStrategy>
            <pendingQueuePolicy>
              <vmQueueCursor/>
            </pendingQueuePolicy>
          </policyEntry>
        </policyEntries>
      </policyMap>
    </destinationPolicy>

    <managementContext>
      <managementContext createConnector="false" connectorHost="
darkhorse.onyx.ove.com"/>
    </managementContext>

    <persistenceAdapter>
      <kahaDB directory="${activemq.data}/kahadb"
              rewriteOnRedelivery="true"
              checksumJournalFiles="true"
              checkForCorruptJournalFiles="true"
              archiveCorruptedIndex="true"
              directoryArchive="${activemq.data}/kahadb/archive"
              enableIndexWriteAsync="true"
              enableJournalDiskSyncs="true"
              enableIndexPageCaching="true"
              concurrentStoreAndDispatchTopics="false"
              concurrentStoreAndDispatchQueues="false"
              indexCacheSize="10000"
              indexWriteBatchSize="10000"
              cleanupInterval="30000"
              checkpointInterval="5000"
              journalMaxFileLength="32mb"
              journalMaxWriteBatchSize="4m"
              lockKeepAlivePeriod="2500"
              useLock="false"/>
    </persistenceAdapter>

    <plugins>
      <statisticsBrokerPlugin/>
      <simpleAuthenticationPlugin>
        <users>
          <authenticationUser username="${activemq.username}"
                              password="${activemq.password}"
                              groups="users,admins"/>
        </users>
      </simpleAuthenticationPlugin>
    </plugins>

    <shutdownHooks>
      <bean xmlns="http://www.springframework.org/schema/beans"
class="org.apache.activemq.hooks.SpringContextHook"/>
    </shutdownHooks>
  </broker>
  <import resource="jetty.xml"/>
</beans>

The launch parameters for ActiveMQ are as shown below:

Running ActiveMQ Broker...
wrapper  | --> Wrapper Started as Console
wrapper  | Java Service Wrapper Community Edition 64-bit 3.5.19
wrapper  |   Copyright (C) 1999-2013 Tanuki Software, Ltd. All Rights
Reserved.
wrapper  |     http://wrapper.tanukisoftware.com
wrapper  |
wrapper  | Command[0] :
/usr/lib/jvm/java-1.6.0-sun-1.6.0.45.x86_64/jre/bin/java
wrapper  | Command[1] : -Dactivemq.home=/usr/share/activemq
wrapper  | Command[2] : -Dactivemq.base=/usr/share/activemq
wrapper  | Command[3] : -Dactivemq.conf=/etc/activemq
wrapper  | Command[4] : -Dactivemq.data=/var/lib/activemq
wrapper  | Command[5] : -Dcom.sun.management.jmxremote
wrapper  | Command[6] : -Dcom.sun.management.jmxremote.port=1616
wrapper  | Command[7] : -Dcom.sun.management.jmxremote.authenticate=true
wrapper  | Command[8] : -Dcom.sun.management.jmxremote.ssl=false
wrapper  | Command[9] :
-Dcom.sun.management.jmxremote.password.file=/etc/activemq/jmx.password
wrapper  | Command[10] :
-Dcom.sun.management.jmxremote.access.file=/etc/activemq/jmx.access
wrapper  | Command[11] : -Djava.util.logging.config.file=logging.properties
wrapper  | Command[12] : -Dsystem.environment=dev
wrapper  | Command[13] :
-Dorg.apache.activemq.store.kahadb.LOG_SLOW_ACCESS_TIME=1500
wrapper  | Command[14] : -Dorg.apache.activemq.audit=true
wrapper  | Command[15] : -XX:+UseG1GC
wrapper  | Command[16] : -Xms150m
wrapper  | Command[17] : -Xmx150m
wrapper  | Command[18] :
-Djava.library.path=/usr/lib64/java-service-wrapper/
wrapper  | Command[19] : -classpath
wrapper  | Command[20] :
/usr/lib64/java-service-wrapper/wrapper.jar:/usr/share/activemq/bin/activemq.jar
wrapper  | Command[21] : -Dwrapper.key=w7SSdyDLtOc3Lsm7
wrapper  | Command[22] : -Dwrapper.port=32001
wrapper  | Command[23] : -Dwrapper.jvm.port.min=31000
wrapper  | Command[24] : -Dwrapper.jvm.port.max=31999
wrapper  | Command[25] : -Dwrapper.pid=6450
wrapper  | Command[26] : -Dwrapper.version=3.5.19
wrapper  | Command[27] : -Dwrapper.native_library=wrapper
wrapper  | Command[28] : -Dwrapper.arch=x86
wrapper  | Command[29] : -Dwrapper.cpu.timeout=10
wrapper  | Command[30] : -Dwrapper.jvmid=1
wrapper  | Command[31] : org.tanukisoftware.wrapper.WrapperSimpleApp
wrapper  | Command[32] : org.apache.activemq.console.Main
wrapper  | Command[33] : start
wrapper  | Command[34] : --extdir
wrapper  | Command[35] : /srv/activemq/grand-central
wrapper  | Launching a JVM...
jvm 1    | WrapperManager: Initializing...
jvm 1    | Java Runtime: Sun Microsystems Inc. 1.6.0_45
/usr/lib/jvm/java-1.6.0-sun-1.6.0.45.x86_64/jre
jvm 1    |   Heap sizes: current=153600k  free=150443k  max=153600k

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message