From c4e99fe48b9cc0597df3de9e82d8dc9c3eb5a63e Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Thu, 9 Mar 2006 05:41:08 +0000 Subject: [PATCH] - Fix NPE due to JMX problem - Made the maven setting a little more eclipse freindly. git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@384438 13f79535-47bb-0310-9956-ffa450edef68 --- activemq-core/project.properties | 8 ++- .../broker/jmx/ManagedRegionBroker.java | 49 +++++++++---------- .../test/eclipse-resources/log4j.properties | 12 +++++ activemq-jaas/project.properties | 2 +- activemq-systest/project.properties | 2 +- assembly/project.properties | 2 +- assembly/src/release/conf/activemq.xml | 9 ++-- etc/project.properties | 6 +++ 8 files changed, 56 insertions(+), 34 deletions(-) create mode 100755 activemq-core/src/test/eclipse-resources/log4j.properties diff --git a/activemq-core/project.properties b/activemq-core/project.properties index 26a7b7f22e..10fbb7759b 100644 --- a/activemq-core/project.properties +++ b/activemq-core/project.properties @@ -2,7 +2,13 @@ # Build Properties # ------------------------------------------------------------------- maven.multiproject.type=jar -maven.eclipse.classpath.include=src/main/resources,src/test/resources,src/gram/java,target/generated + +maven.eclipse.classpath.include=\ +${basedir}/src/main/resources,\ +${basedir}/src/test/eclipse-resources,\ +${basedir}/src/test/resources,\ +${basedir}/src/gram/java,\ +${basedir}/target/generated openwire.version=1 diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java index 5159025fbb..28ec1b724c 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java @@ -13,8 +13,27 @@ */ package org.apache.activemq.broker.jmx; -import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap; -import edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArraySet; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; + +import javax.management.InstanceNotFoundException; +import javax.management.MBeanServer; +import javax.management.MalformedObjectNameException; +import javax.management.ObjectName; +import javax.management.openmbean.CompositeData; +import javax.management.openmbean.CompositeDataSupport; +import javax.management.openmbean.CompositeType; +import javax.management.openmbean.OpenDataException; +import javax.management.openmbean.TabularData; +import javax.management.openmbean.TabularDataSupport; +import javax.management.openmbean.TabularType; import org.apache.activemq.broker.Broker; import org.apache.activemq.broker.BrokerService; @@ -44,28 +63,8 @@ import org.apache.activemq.util.SubscriptionKey; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import javax.management.InstanceNotFoundException; -import javax.management.MBeanRegistrationException; -import javax.management.MBeanServer; -import javax.management.MalformedObjectNameException; -import javax.management.ObjectName; -import javax.management.openmbean.CompositeData; -import javax.management.openmbean.CompositeDataSupport; -import javax.management.openmbean.CompositeType; -import javax.management.openmbean.OpenDataException; -import javax.management.openmbean.TabularData; -import javax.management.openmbean.TabularDataSupport; -import javax.management.openmbean.TabularType; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Map.Entry; +import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap; +import edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArraySet; public class ManagedRegionBroker extends RegionBroker{ private static final Log log=LogFactory.getLog(ManagedRegionBroker.class); @@ -167,7 +166,7 @@ public class ManagedRegionBroker extends RegionBroker{ public void registerSubscription(ConnectionContext context,Subscription sub){ SubscriptionKey key = new SubscriptionKey(context.getClientId(),sub.getConsumerInfo().getSubcriptionName()); Hashtable map=brokerObjectName.getKeyPropertyList(); - String name = key.toString() + ":" + sub.getConsumerInfo().getConsumerId().toString(); + String name = key.toString(); try{ ObjectName objectName = new ObjectName( diff --git a/activemq-core/src/test/eclipse-resources/log4j.properties b/activemq-core/src/test/eclipse-resources/log4j.properties new file mode 100755 index 0000000000..52f3102584 --- /dev/null +++ b/activemq-core/src/test/eclipse-resources/log4j.properties @@ -0,0 +1,12 @@ +# +# The logging properties used for eclipse testing, We want to see debug output on the console. +# +log4j.rootLogger=DEBUG, out + +log4j.logger.org.apache.activemq.spring=WARN + +# CONSOLE appender not used by default +log4j.appender.out=org.apache.log4j.ConsoleAppender +log4j.appender.out.layout=org.apache.log4j.PatternLayout +log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n +#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n diff --git a/activemq-jaas/project.properties b/activemq-jaas/project.properties index 5d0a89cc3f..fa48247840 100644 --- a/activemq-jaas/project.properties +++ b/activemq-jaas/project.properties @@ -7,6 +7,6 @@ http://cvs.apache.org/repository # Build Properties # ------------------------------------------------------------------- maven.multiproject.type=jar -maven.eclipse.classpath.include=src/test/resources +maven.eclipse.classpath.include=${basedir}/src/test/resources maven.junit.jvmargs=-Djava.security.auth.login.config=src/test/resources/login.config diff --git a/activemq-systest/project.properties b/activemq-systest/project.properties index 22d42346cd..777c5cfa7d 100755 --- a/activemq-systest/project.properties +++ b/activemq-systest/project.properties @@ -7,7 +7,7 @@ http://cvs.apache.org/repository # Build Properties # ------------------------------------------------------------------- maven.multiproject.type=jar -maven.eclipse.classpath.include=src/test/resources +maven.eclipse.classpath.include=${basedir}/src/test/resources maven.changelog.range=730 diff --git a/assembly/project.properties b/assembly/project.properties index d735f16a22..de57655bfb 100755 --- a/assembly/project.properties +++ b/assembly/project.properties @@ -20,4 +20,4 @@ http://www.openejb.org/maven maven.jar.mainclass = org.apache.activemq.console.Main -maven.eclipse.classpath.include=src/test/resources \ No newline at end of file +maven.eclipse.classpath.include=${basedir}/src/test/resources diff --git a/assembly/src/release/conf/activemq.xml b/assembly/src/release/conf/activemq.xml index 59728c189a..878057faa8 100755 --- a/assembly/src/release/conf/activemq.xml +++ b/assembly/src/release/conf/activemq.xml @@ -29,16 +29,15 @@ - - - + + - + diff --git a/etc/project.properties b/etc/project.properties index 072303dac8..0474e6d7a7 100755 --- a/etc/project.properties +++ b/etc/project.properties @@ -42,6 +42,12 @@ http://jakarta.apache.org/commons/logging/apidocs maven.javadoc.additionalparam = -linksource +# ------------------------------------------------------------------- +# Eclipse IDE Properties +# ------------------------------------------------------------------- +maven.eclipse.output.dir=${basedir}/target/eclipse +maven.eclipse.test.output.dir=${basedir}target/eclipse + # ------------------------------------------------------------------- # Checkstyle Properties # -------------------------------------------------------------------