From: Anil S. <osd...@us...> - 2005-02-02 05:22:19
|
User: osdchicago Date: 05/02/01 21:22:12 Modified: src/main/org/jboss/invocation/pooled/server Tag: Branch_4_0 PooledInvoker.java Log: When a service fails to bind to a port because of java.net.BindException, append the port number to the error message so that basic users can figure out which port is already in use. Revision Changes Path No revision No revision 1.10.2.2 +10 -3 jboss/src/main/org/jboss/invocation/pooled/server/PooledInvoker.java Index: PooledInvoker.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/invocation/pooled/server/PooledInvoker.java,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -u -r1.10.2.1 -r1.10.2.2 --- PooledInvoker.java 17 Oct 2004 21:05:50 -0000 1.10.2.1 +++ PooledInvoker.java 2 Feb 2005 05:22:11 -0000 1.10.2.2 @@ -16,6 +16,7 @@ import java.security.PrivilegedExceptionAction; import java.security.AccessController; import java.security.PrivilegedActionException; +import java.io.IOException; import javax.management.ObjectName; import javax.naming.InitialContext; import javax.transaction.Transaction; @@ -49,7 +50,7 @@ * on the server side. Pool, is an LRU pool, so resources should be cleaned up. * * @author <a href="mailto:bi...@jb...">Bill Burke</a> - * @version $Revision: 1.10.2.1 $ + * @version $Revision: 1.10.2.2 $ * * @jmx:mbean extends="org.jboss.system.ServiceMBean" */ @@ -170,8 +171,14 @@ clientpool = new LRUPool(2, maxPoolSize); clientpool.create(); threadpool = new LinkedList(); - serverSocket = new ServerSocket(serverBindPort, backlog, bindAddress); - serverBindPort = serverSocket.getLocalPort(); + try + { + serverSocket = new ServerSocket(serverBindPort, backlog, bindAddress); + }catch( java.net.BindException be) + { + throw new Exception("Port "+serverBindPort+" is already in use",be); + } + serverBindPort = serverSocket.getLocalPort(); clientConnectPort = (clientConnectPort == 0) ? serverSocket.getLocalPort() : clientConnectPort; ServerAddress sa = new ServerAddress(clientConnectAddress, clientConnectPort, enableTcpNoDelay, timeout); |