activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phillip McCarley (JIRA)" <>
Subject [jira] [Created] (AMQ-3870) ArrayIndexOutOfBoundsException when using Multi kahaDB (mKahaDB) adapter, per-destination adapters and Topics
Date Thu, 31 May 2012 00:30:22 GMT
Phillip McCarley created AMQ-3870:

             Summary: ArrayIndexOutOfBoundsException when using Multi kahaDB (mKahaDB) adapter,
per-destination adapters and Topics
                 Key: AMQ-3870
             Project: ActiveMQ
          Issue Type: Bug
          Components: Message Store
    Affects Versions: 5.6.0
         Environment: Java v1.6.0_21
Windows XP SP3
            Reporter: Phillip McCarley

Steps to reproduce the issue:

- Unpack clean "" to local drive.
- Change the default configuration to use the mKahaDB adapter and per-destination instances
(exactly as given at in the very last config snippet).
See also attached activemq.xml
- Start up ActiveMQ from bin/activemq.bat
- Run a small test program that simply creates a Topic and attempts to consume (that main
point here is that the Topic is created and due to "per-destination" mKahaDB, a folder is
created in the data directory specifically for this Topic.
- Shutdown ActiveMQ normally.
- Restart ActiveMQ normally, and the ArrayIndexOutOfBoundsException will be thrown. (see attached

I have done some investigation and it seems that on restart when it is attempting to "registerExistingAdapter",
it wants to register each adapter with one of the destinations (the first in fact) that each
adapter applies to (adapter.getDestinations()...[0]). However, in getDestinations(), empty
topics get filtered out of the return value, and since we are using per-destination="true"
there can be adapters for topics only and so a chance that getDestinations() returns an empty
List. Hence causing the Exception when trying to access the first destination from that list.

The reason that I haven't gone further, to supply a patch, is that I am unsure of what would
be an appropriate way to register these adapters, or if you could leave them and not register
them anyway, since they are empty topics.

Note, that if you extend the configuration of the mKahaDB adapter to provide an explicit adapter
for all topics, then the issue goes away. (see commented part of mKahaDB config in activemq.xml

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message