本文档是在jboss-5.1.0.GA版本上做的调试:
最常见的端口冲突就是1098端口,下面针对1098端口进行简单说明:
可能原因:
1、 已有jboss运行中(有时关机时jboss没有关闭,下次开机后启动jboss会报端口占用)
解决办法如下:
调用jboss的关闭脚本,如我的jboss安装路径为D:\server\ams\jboss-5.1.0.GA\,
则打开cmd,运行cd D:\server\ams\jboss-5.1.0.GA\bin;进入bin目录,然后运行 shutdown –S
即可。
2、端口被其他程序占用。
解决办法如下:
方案一:查看并结束掉占用1098端口的进程,然后通过任务管理器杀掉该进程即可。
进入cmd,输入如下命令netstat -a -o –n,能看到类似下面的结果
Proto Local Address Foreign Address State PID
TCP 127.0.0.1:1098 0.0.0.0:0 LISTENING 4324
这个4324进程就是占用1098端口的元凶,打开任务管理器找到该进程结束掉即可。
备注:Windows 任务管理器默认是不显示PID的,需要进行一下设置。
进入windows 任务管理器,选中“进程”标签页,然后点击工具条上的“查看”-> “选择列” -> “选中PID” (如图)
方案二:修改jboss的监听端口,方法如下:
修改文件\server\default\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml
第二篇:修改JBOSS端口
解决两个JBOSS部署在同一台服务器时端口占用问题
当两个JBOSS部署在同一台服务器上时,需要修改下面的端口值
1, jboss-4.2.2.GA\server\default\deploy\ejb3.deployer\META-INF下打开jboss-service.xml文件
第12行修改3873的端口值
<mbean code="org.jboss.remoting.transport.Connector"
name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3"> <depends>jboss.aop:service=AspectDeployer</depends>
<attribute name="InvokerLocator">socket://${jboss.bind.address}:3873</attribute> <attribute name="Configuration">
<handlers>
<handler
2, jboss-4.2.2.GA\server\default\deploy\jboss-web.deployer下打开server.xml文件 修改80,8009,8443的
端口值
a. 第22行修改80端口;
b. 第25行修改8443端口;
<Connector port="80" address="${jboss.bind.address}"
maxThreads="250" maxHttpHeaderSize="8192"
emptySessionPath="true" protocol="HTTP/1.1"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8" /> c. 第39行修改8009端口;
emptySessionPath="true" enableLookups="false" redirectPort="9445" />
<Engine name="jboss.web" defaultHost="localhost">
3, jboss-4.2.2.GA\server\default\conf下打开jboss-service.xml文件,修改8083,1098,1099,4444,4445,
4446的端口值
a. 第210行修改8083端口;
<mbean code="org.jboss.web.WebService"
name="jboss:service=WebService">
<!-- The Bind address and Port -->
<attribute name="BindAddress">${jboss.bind.address}</attribute>
<attribute name="Port">8083</attribute>
<!-- The address to use for the host portion of the RMI codebase URL -->
<attribute name="Host">${java.rmi.server.hostname}</attribute>
<!-- Should non-EJB .class files be downloadable -->
<attribute name="DownloadServerClasses">true</attribute>
b. 第257行修改1098端口
<!-- The port of the RMI naming service, 0 == anonymous -->
<attribute name="RmiPort">1098</attribute>
<!-- The RMI service bind address. Empty == all addresses
-->
c. 第251行修改1099的端口值
<attribute name="Port">1099</attribute>
d. 第426行修改4444端口值
<mbean code="org.jboss.invocation.jrmp.server.JRMPInvoker"
name="jboss:service=invoker,type=jrmp">
<attribute name="RMIObjectPort">4444</attribute>
<attribute name="ServerAddress">${jboss.bind.address}</attribute>
e. 第450行修改4445的端口值
<mbean code="org.jboss.invocation.pooled.server.PooledInvoker"
name="jboss:service=invoker,type=pooled">
<attribute name="NumAcceptThreads">1</attribute>
<attribute name="MaxPoolSize">300</attribute>
<attribute name="ClientMaxPoolSize">300</attribute>
<attribute name="SocketTimeout">60000</attribute>
<attribute name="ServerBindAddress">${jboss.bind.address}</attribute>
<attribute name="ServerBindPort">4445</attribute>
<attribute name="ClientConnectAddress">${jboss.bind.address}</attribute>
<attribute name="ClientConnectPort">0</attribute>
<attribute name="ClientRetryCount">1</attribute>
<attribute name="EnableTcpNoDelay">false</attribute>
f. 第510行修改4446的端口值
<attribute name="socketTimeout" isParam="true">600000</attribute>
<attribute name="serverBindAddress">${jboss.bind.address}</attribute>
<attribute name="serverBindPort">4446</attribute>
4, jboss-4.2.2.GA\server\default\conf打开jboss-minimal.xml文件,修改1099的端口值,与第3步中的修
改一致
第76行修改1099的值
<attribute name="Port">1099</attribute>
5,jboss-4.2.2.GA\server\default\deploy\jms下打开uil2-service.xml,修改8093的端口值
第22行修改8093的端口值
<attribute name="ServerBindPort">8093</attribute>