Any agrument that you pass to run.bat at passed to the app server as the token "%*" at ther end of line 114:
"%JAVA%" %JAVA_OPTS% ... org.jboss.Main %*
Simply change the %* to reflect your desired options:
"%JAVA%" %JAVA_OPTS% ... org.jboss.Main -c WEBAPP
Another possibility is to modify the service.bat file for the cmdStart label as follows:
REM Executed on service start
call run.bat -c WEBAPP >run.log
This change is better because it leaves the run.bat as it.
Thank you for responding. Please let me know if my understanding is accurate.
If I want to run multiple servers, I will need to create multiple service_xxx.bat. In each bat file, I will give a new SVCNAME, SVCDISP, modify the cmdInstall to pass in service_xxx.bat and -c xxx and modify cmdRestart to pass in -c xxx. Then run the service_xxx.bat install to create each service.
Am I on the right track here?
Yes, that is what I did. I also renamed the *.log files generated by service_*.bat so each service creates its own logs.
If you plan to run all of the services at the same time then you will also have to be concerned with port conflicts. See http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfiguringMultipleJBossInstancesOnOneMachine
You will also have to modify the parameters shutdown.bat (within service_*.bat) to shut down the correct service. Look at the -s option (run shutdown.bat without any parameters to get the help text).
I still need some help here with shutdown.
I am able to use shutdown -S (uppercase) to shutdown a server. But, I cannot figure out the correct syntax for shutdown -s (lowercase).
If I started a server with run.bat -c MYAPP1 and run.bat -c MYAPP2, what are the correct shutdown command syntax? shutdown -s MYAPP1? shutdown -s server=MYAPP1?
The -s option takes a URL that includes the host name and the port for JNDI. In a default installation that would be "-s localhost:1099".
Unlike run, which needs to know the directory containing the server to start, shutdown needs to know where the server is listening so that it can get the jboss.system:type=Server MBean.