I got it working on my own. The answer were these commands:
.\run.bat -Djboss.service.binding.set=ports-01 -c ports-01
.\run.bat -Djboss.service.binding.set=ports-02 -c ports-02
Also, I had to copy the server/default to 2 new directories called server/ports-01 and server/ports-02 ...
Then , in the server\ports-01\conf\bindingservice.beans\META-INF I had to remove references to instances ports-02, ports-03, and "default" from it.
Then , in the server\ports-02\conf\bindingservice.beans\META-INF I had to remove references to instances ports-01, ports-03, and "default" from it.
Then, finally, I deleted the "standard", "web", and "default" directories from the default installation in the server directory.
Then, I ran both servers with the commands above, and out-of-the-box, they work.
Also, here is a batch file to run clustered instead of separate instances:
@echo off
start .\bin\run.bat -c ports-01 -g MyLocal -u 239.255.100.100 -b 127.0.0.1 -Djboss.messaging.ServerPeerID=1 -Djboss.service.binding.set=ports-01
@echo Wait until first server finishes starting and then hit
@echo any key to start the second server in the cluster...
pause
start .\bin\run.bat -c ports-02 -g MyLocal -u 239.255.100.100 -b 127.0.0.1 -Djboss.messaging.ServerPeerID=2 -Djboss.service.binding.set=ports-02
The cleanup method in use seems to be to edit the bin/run.bat script so that the tmp folder is deleted before JBoss starts. I've got this at the top of run.bat:
rem ******** CLEAR TMP, WORK, LOG ***************
rmdir /s /q c:\apps\jboss-5.1.0.ga\server\default\tmp
rmdir /s /q c:\apps\jboss-5.1.0.ga\server\default\work
rmdir /s /q c:\apps\jboss-5.1.0.ga\server\default\log
mkdir c:\apps\jboss-5.1.0.ga\server\default\tmp
mkdir c:\apps\jboss-5.1.0.ga\server\default\work
mkdir c:\apps\jboss-5.1.0.ga\server\default\log
echo --- Cleared temp folders ---
Best Answer
Some discussion: https://community.jboss.org/thread/150212
Deployment using MainDeployer seems to be the cause as this problem did not happen when deploying exploded ear manually in to the server/all/deploy.