Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 77657 invoked from network); 10 Jun 2008 09:21:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jun 2008 09:21:51 -0000 Received: (qmail 94596 invoked by uid 500); 10 Jun 2008 09:21:54 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 94572 invoked by uid 500); 10 Jun 2008 09:21:53 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 94560 invoked by uid 99); 10 Jun 2008 09:21:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jun 2008 02:21:53 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jun 2008 09:21:12 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6E252234C139 for ; Tue, 10 Jun 2008 02:21:00 -0700 (PDT) Message-ID: <417289102.1213089660449.JavaMail.jira@brutus> Date: Tue, 10 Jun 2008 02:21:00 -0700 (PDT) From: "Mario Lukica (JIRA)" To: dev@activemq.apache.org Subject: [jira] Commented: (AMQ-1508) Using a destinationDotFilePlugin results in an ArrayStoreException In-Reply-To: <32972339.1196351006769.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-1508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43367#action_43367 ] Mario Lukica commented on AMQ-1508: ----------------------------------- Version 4.1.2 is also affected. > Using a destinationDotFilePlugin results in an ArrayStoreException > ------------------------------------------------------------------ > > Key: AMQ-1508 > URL: https://issues.apache.org/activemq/browse/AMQ-1508 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Affects Versions: 4.1.1 > Environment: Windows > ActiveMQ 4.1.1 > Reporter: Peter Mortier > Assignee: Rob Davies > Priority: Minor > Attachments: activemq.xml > > Original Estimate: 5 minutes > Remaining Estimate: 5 minutes > > When you add a destinationDotFilePlugin to the activemq configuration, like this: > > > > > ... > > The Broker refuses to start up and crashes with ArrayStoreException: > ERROR BrokerService - Failed to start ActiveMQ JMS Message Broker. Reason: java.lang.ArrayStoreExceptio > n > java.lang.ArrayStoreException > at java.lang.System.arraycopy(Native Method) > at java.util.ArrayList.toArray(ArrayList.java:304) > at org.apache.activemq.broker.region.RegionBroker.getDestinations(RegionBroker.java:315) > at org.apache.activemq.broker.BrokerFilter.getDestinations(BrokerFilter.java:149) > at org.apache.activemq.broker.BrokerFilter.getDestinations(BrokerFilter.java:149) > at org.apache.activemq.broker.BrokerFilter.getDestinations(BrokerFilter.java:149) > at org.apache.activemq.broker.BrokerFilter.getDestinations(BrokerFilter.java:149) > at org.apache.activemq.broker.view.DestinationDotFileInterceptor.generateFile(DestinationDotFileInterceptor.java:53) > at org.apache.activemq.broker.view.DotFileInterceptorSupport.generateFile(DotFileInterceptorSupport.java:48) > at org.apache.activemq.broker.view.DestinationDotFileInterceptor.addDestination(DestinationDotFileInterceptor.java:43) > at org.apache.activemq.broker.MutableBrokerFilter.addDestination(MutableBrokerFilter.java:151) > at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:1619) > at org.apache.activemq.broker.BrokerService.start(BrokerService.java:410) > at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:46) > at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201) > at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171) > at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425) > at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) > at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156) > at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) > at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) > at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287) > The bug is in RegionBroker.getDestinations method: > public ActiveMQDestination[] getDestinations() throws Exception { > ArrayList l; > l = new ArrayList(destinations.values()); > ActiveMQDestination rc[] = new ActiveMQDestination[l.size()]; > l.toArray(rc); > return rc; > } > The destinations property is Map where the keys are ActiveMQDestinations and the values are Destinations. Trying to convert a collection of Destinations to an array of ActiveMQConnections throws the aforementioned exception. > The method should be changed to: > public ActiveMQDestination[] getDestinations() throws Exception { > ArrayList l; > l = new ArrayList(destinations.keySet()); > ActiveMQDestination rc[] = new ActiveMQDestination[l.size()]; > l.toArray(rc); > return rc; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.