appclient.bat 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. @echo off
  2. rem -------------------------------------------------------------------------
  3. rem JBoss Application Client Bootstrap Script for Windows
  4. rem -------------------------------------------------------------------------
  5. rem $Id$
  6. @if not "%ECHO%" == "" echo %ECHO%
  7. @if "%OS%" == "Windows_NT" setlocal
  8. if "%OS%" == "Windows_NT" (
  9. set "DIRNAME=%~dp0%"
  10. ) else (
  11. set DIRNAME=.\
  12. )
  13. rem Read an optional configuration file.
  14. if "x%APPCLIENT_CONF%" == "x" (
  15. set "APPCLIENT_CONF=%DIRNAME%appclient.conf.bat"
  16. )
  17. if exist "%APPCLIENT_CONF%" (
  18. echo Calling %APPCLIENT_CONF%
  19. call "%APPCLIENT_CONF%" %*
  20. ) else (
  21. echo Config file not found %APPCLIENT_CONF%
  22. )
  23. pushd %DIRNAME%..
  24. set "RESOLVED_JBOSS_HOME=%CD%"
  25. popd
  26. if "x%JBOSS_HOME%" == "x" (
  27. set "JBOSS_HOME=%RESOLVED_JBOSS_HOME%"
  28. )
  29. pushd "%JBOSS_HOME%"
  30. set "SANITIZED_JBOSS_HOME=%CD%"
  31. popd
  32. if "%RESOLVED_JBOSS_HOME%" NEQ "%SANITIZED_JBOSS_HOME%" (
  33. echo WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.
  34. )
  35. set DIRNAME=
  36. if "%OS%" == "Windows_NT" (
  37. set "PROGNAME=%~nx0%"
  38. ) else (
  39. set "PROGNAME=appclient.bat"
  40. )
  41. rem Setup JBoss specific properties
  42. set JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%
  43. if "x%JAVA_HOME%" == "x" (
  44. set JAVA=java
  45. echo JAVA_HOME is not set. Unexpected results may occur.
  46. echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
  47. ) else (
  48. set "JAVA=%JAVA_HOME%\bin\java"
  49. )
  50. rem Add -server to the JVM options, if supported
  51. "%JAVA%" -server -version 2>&1 | findstr /I hotspot > nul
  52. if not errorlevel == 1 (
  53. set "JAVA_OPTS=%JAVA_OPTS% -server"
  54. )
  55. rem Find run.jar, or we can't continue
  56. if exist "%JBOSS_HOME%\jboss-modules.jar" (
  57. set "RUNJAR=%JBOSS_HOME%\jboss-modules.jar"
  58. ) else (
  59. echo Could not locate "%JBOSS_HOME%\jboss-modules.jar".
  60. echo Please check that you are in the bin directory when running this script.
  61. goto END
  62. )
  63. rem Setup JBoss specific properties
  64. rem Setup the java endorsed dirs
  65. set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed
  66. rem Set default module root paths
  67. if "x%JBOSS_MODULEPATH%" == "x" (
  68. set "JBOSS_MODULEPATH=%JBOSS_HOME%\modules"
  69. )
  70. "%JAVA%" %JAVA_OPTS% ^
  71. "-Dorg.jboss.boot.log.file=%JBOSS_HOME%\appclient\log\appclient.log" ^
  72. "-Dlogging.configuration=file:%JBOSS_HOME%/appclient/configuration/logging.properties" ^
  73. -jar "%JBOSS_HOME%\jboss-modules.jar" ^
  74. -mp "%JBOSS_MODULEPATH%" ^
  75. -jaxpmodule "javax.xml.jaxp-provider" ^
  76. org.jboss.as.appclient ^
  77. -Djboss.home.dir="%JBOSS_HOME%" ^
  78. -Djboss.server.base.dir="%JBOSS_HOME%\appclient" ^
  79. %*