You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2011/02/26 23:52:40 UTC

svn commit: r1074948 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java

Author: tabish
Date: Sat Feb 26 22:52:39 2011
New Revision: 1074948

URL: http://svn.apache.org/viewvc?rev=1074948&view=rev
Log:
fix for: https://issues.apache.org/jira/browse/AMQ-2256 

suppress the stack trace output for the error and just log a warning that the URI path is not valid for binding to a local port.  Output the full exception stack trace if debug logging is turned on.

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java?rev=1074948&r1=1074947&r2=1074948&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java Sat Feb 26 22:52:39 2011
@@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory;
 
 /**
  * @author David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com (logging improvement modifications)
- * 
+ *
  */
 public class TcpTransportFactory extends TransportFactory {
     private static final Logger LOG = LoggerFactory.getLogger(TcpTransportFactory.class);
@@ -68,7 +68,7 @@ public class TcpTransportFactory extends
     /**
      * Allows subclasses of TcpTransportFactory to create custom instances of
      * TcpTransportServer.
-     * 
+     *
      * @param location
      * @param serverSocketFactory
      * @return
@@ -86,7 +86,7 @@ public class TcpTransportFactory extends
 
         Map<String, Object> socketOptions = IntrospectionSupport.extractProperties(options, "socket.");
         tcpTransport.setSocketOptions(socketOptions);
-        
+
         if (tcpTransport.isTrace()) {
             try {
                 transport = TransportLoggerFactory.getInstance().createTransportLogger(transport, tcpTransport.getLogWriterName(),
@@ -101,7 +101,7 @@ public class TcpTransportFactory extends
             transport = new InactivityMonitor(transport, format);
             IntrospectionSupport.setProperties(transport, options);
         }
-        
+
 
         // Only need the WireFormatNegotiator if using openwire
         if (format instanceof OpenWireFormat) {
@@ -129,7 +129,10 @@ public class TcpTransportFactory extends
                 String localString = location.getScheme() + ":/" + path;
                 localLocation = new URI(localString);
             } catch (Exception e) {
-                LOG.warn("path isn't a valid local location for TcpTransport to use", e);
+                LOG.warn("path isn't a valid local location for TcpTransport to use", e.getMessage());
+                if(LOG.isDebugEnabled()) {
+                    LOG.debug("Failure detail", e);
+                }
             }
         }
         SocketFactory socketFactory = createSocketFactory();
@@ -139,7 +142,7 @@ public class TcpTransportFactory extends
     /**
      * Allows subclasses of TcpTransportFactory to provide a create custom
      * TcpTransport intances.
-     * 
+     *
      * @param location
      * @param wf
      * @param socketFactory