把端口改了就行了,不过不只改一个端口,好几个呢,

解决方案 »

  1.   

    Setting up multiple instances of JBoss on the same machine
    1. 拷贝jboss_home\server\default到jboss_home\server\xxx2. 按照下面的步骤改写端口号I was able to setup a second instance of JBoss 3.2.0 on the same machine simply by changing the ports 
    of the 2nd installation of JBoss.  I believe this would also work for more than 2 instances.  
    In brief, to get my second JBoss installation to run, in most of the files I changed the ports by 
    prepending an extra "1" to the default port numbers resulting in ports in the ~10000 range.JBoss Configuration Files to Change:(该文件如果没有,则不需要进行修改)(1) In <jboss_home>/server/xxx/conf/jboss-service.xml, edit the following: 
    For the mbean org.jboss.web.WebService, change the port setting line to (8083 is the default):
    <attribute name="Port">18083</attribute> 
    For the mbean org.jboss.naming.NamingService, change the port setting line to (1099 is the default):
    <attribute name="Port">11099</attribute> 
    For the mbean org.jboss.invocation.jrmp.server.JRMPInvoker, change the port setting line to (4444 is the default):
    <attribute name="RMIObjectPort">14444</attribute> 
     (2) In <jboss_home>/server/xxx/deploy/cluster-service.xml, edit the following: 
    For the mbean org.jboss.ha.jndi.HANamingService, add this port setting (1100 is the default so I just prefixed an extra "1"):
    <attribute name="Port">11100</attribute> 
    Also for the mbean org.jboss.ha.jndi.HANamingService, add this port setting (0 is the default, I just made it 19000 to keep things sort of consistent with the above):
    <attribute name="RmiPort">19000</attribute> 
     (3) In <jboss_home>/server/xxx/deploy/jbossmq-service.xml, edit the following: 
    For the mbean org.jboss.mq.il.oil.OILServerILService, change the port setting line to (8090 is the default):
    <attribute name="ServerBindPort">18090</attribute> 
    For the mbean org.jboss.mq.il.uil.UILServerILService, change the port setting line to (8091 is the default):
    <attribute name="ServerBindPort">18091</attribute> 
    For the mbean org.jboss.mq.il.oil2.OIL2ServerILService, change the port setting line to (8092 is the default):
    <attribute name="ServerBindPort">18092</attribute> 
    For the mbean org.jboss.mq.il.uil2.UILServerILService, change the port setting line to (8093 is the default):
    <attribute name="ServerBindPort">18093</attribute> 
     (4) In <jboss_home>/server/xxx/deploy/hsqldb-ds.xml, edit the following: For the mbean org.jboss.jdbc.HypersonicDatabase, change the port setting line to (1701 is the default):
    <attribute name="Port">11701</attribute> 
    Change the local-tx-datasource to reflect the new port setting line (1701 is the default):
    <connect-url>jdbc:hsqldb:hsql://localhost:11701</connect-url> 
     (5) In <jboss_home>/server/xxx/deploy/jbossweb-tomcat.sar/META-INF/jboss-service.xml, edit the following: 
    Under the "Configure the Request Listeners" section, look for the add listener call of "org.mortbay.http.SocketListener" and change the port setting line to (8080 is the default):
    <Set name="Port"><SystemProperty name="jetty.port" default="18080"/></Set> 
    这个端口是用来http侦听的。
    -------------
    Under the "Configure the Request Listeners" section, look for the add listener call of "org.mortbay.http.ajp.AJP13Listener" and change the port setting line to (8009 is the default):
    <Set name="Port">18009</Set>
    Also the call "org.mortbay.http.ajp.AJP13Listener", change the port setting line to (8443 is the default):
    <Set name="confidentialPort">18443</Set> 
     (6) In <jboss_home>/server/xxx/deploy/jmx-rmi-adaptor.sar/META-INF/jboss-service.xml, edit the following: 
    For the mbean org.jboss.jmx.adaptor.rmi.RMIAdaptorService, change the port setting line to (0 is the default, but I made it 19001 since we already used 19000):
    <attribute name="RMIObjectPort">19001</attribute> 
     (7) In <jboss_home>/server/xxx/conf/jacorb.properties, edit the following: 
    For the line OAPort=n, change the port setting line to (3528 is the default):
    OAPort=13528 
     Now execute the run.bat or run.sh script from the <jboss_home>/bin directory in each of the JBoss instances (in sequence, one after the other) and things should work! 
    运行的格式:
    run -c default
    run -c xxx
    To shutdown the different instances:Execute the shutdown.bat or shutdown.sh script from the <jboss_home>/bin directory with 2 extra arguments.  The first argument is the hostname and the second is the port number.In our example you would shutdown the JBoss instance that is configured with default ports using this command:
    <jboss_home>\bin\shutdown.bat localhost 8080 -u <username> -p <password>And for the second instance with the modified ports, use this command:
    <jboss_home>\bin\shutdown.bat localhost 18080 -u <username> -p <password>