diff --git a/activemq-optional/src/main/java/org/apache/activemq/axis/ActiveMQVendorAdapter.java b/activemq-optional/src/main/java/org/apache/activemq/axis/ActiveMQVendorAdapter.java index 2f196fd952..2c1b3f5e1e 100755 --- a/activemq-optional/src/main/java/org/apache/activemq/axis/ActiveMQVendorAdapter.java +++ b/activemq-optional/src/main/java/org/apache/activemq/axis/ActiveMQVendorAdapter.java @@ -90,7 +90,7 @@ public class ActiveMQVendorAdapter extends BeanVendorAdapter { // compare broker url String propertyBrokerURL = (String)properties.get(BROKER_URL); - if (!brokerURL.equals(propertyBrokerURL)) { + if (brokerURL == null || !brokerURL.equals(propertyBrokerURL)) { return false; } return true; diff --git a/activemq-optional/src/main/java/org/apache/activemq/benchmark/BenchmarkSupport.java b/activemq-optional/src/main/java/org/apache/activemq/benchmark/BenchmarkSupport.java index 6b31df377d..477ce5e443 100755 --- a/activemq-optional/src/main/java/org/apache/activemq/benchmark/BenchmarkSupport.java +++ b/activemq-optional/src/main/java/org/apache/activemq/benchmark/BenchmarkSupport.java @@ -176,7 +176,7 @@ public class BenchmarkSupport { times++; } if (times > 0) { - average = total / times; + average = total / (double) times; } System.out.println(getClass().getName() + " Processed: " + processed + " messages this second. Average: " + average); diff --git a/activemq-optional/src/main/java/org/apache/activemq/benchmark/Producer.java b/activemq-optional/src/main/java/org/apache/activemq/benchmark/Producer.java index e305d549f1..2c2b20cec9 100755 --- a/activemq-optional/src/main/java/org/apache/activemq/benchmark/Producer.java +++ b/activemq-optional/src/main/java/org/apache/activemq/benchmark/Producer.java @@ -174,6 +174,7 @@ public class Producer extends BenchmarkSupport { buffer.append(line); buffer.append(File.separator); } + in.close(); return buffer.toString(); } } diff --git a/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportFactory.java b/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportFactory.java index 659143fd32..24a6524ecc 100755 --- a/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportFactory.java +++ b/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportFactory.java @@ -22,7 +22,7 @@ import java.util.Map; import org.apache.activemq.transport.Transport; import org.apache.activemq.transport.TransportFactory; -import org.apache.activemq.transport.TransportLogger; +import org.apache.activemq.transport.TransportLoggerFactory; import org.apache.activemq.transport.TransportServer; import org.apache.activemq.transport.util.TextWireFormat; import org.apache.activemq.transport.xstream.XStreamWireFormat; @@ -59,10 +59,14 @@ public class HttpTransportFactory extends TransportFactory { } public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { - HttpClientTransport httpTransport = (HttpClientTransport)super.compositeConfigure(transport, format, options); + HttpClientTransport httpTransport = (HttpClientTransport) super.compositeConfigure(transport, format, options); transport = httpTransport; - if (httpTransport.isTrace()) { - transport = new TransportLogger(httpTransport); + if( httpTransport.isTrace() ) { + try { + transport = TransportLoggerFactory.getInstance().createTransportLogger(transport); + } catch (Throwable e) { + LOG.error("Could not create TransportLogger object for: " + TransportLoggerFactory.defaultLogWriterName + ", reason: " + e, e); + } } return transport; }