Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 52813 invoked from network); 29 Nov 2007 15:43:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Nov 2007 15:43:51 -0000 Received: (qmail 62791 invoked by uid 500); 29 Nov 2007 15:43:38 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 62767 invoked by uid 500); 29 Nov 2007 15:43:38 -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 62758 invoked by uid 99); 29 Nov 2007 15:43:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2007 07:43:38 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2007 15:43:48 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C0EF7714209 for ; Thu, 29 Nov 2007 07:43:26 -0800 (PST) Message-ID: <32972339.1196351006769.JavaMail.jira@brutus> Date: Thu, 29 Nov 2007 07:43:26 -0800 (PST) From: "Peter Mortier (JIRA)" To: dev@activemq.apache.org Subject: [jira] Created: (AMQ-1508) Using a destinationDotFilePlugin results in an ArrayStoreException MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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 Priority: Minor 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.