axis 开发的webservice上线后偶尔报错,用jmeter加压的情况下重启tomcat这种情况更容易出现!:
java.net.BindException: Address already in use: connect
虽然不影响最终使用但总感觉不爽,上老外的网站找到如下方法,问题解决(应该是跟window tcpip连接的上线默认为5000有关):
- Start Registry Editor (Regedt32.exe).
- Locate the following key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
- On the Edit menu, click Add Value, and then add the following registry value:
Value Name: MaxUserPort Data Type: REG_DWORD Value: 65534 <for example>
Valid Range: 5000-65534 (decimal) Default: 0x1388 (5000 decimal)
Description: This parameter controls the maximum port number used when an application requests any available user port from the system. Normally, ephemeral (that is, short-lived) ports are allocated between the values of 1024 and 5000 inclusive.
- Quit Registry Editor.
最好重启window。