jdr.bat 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. @echo off
  2. rem -------------------------------------------------------------------------
  3. rem JBoss Diagnostic Report (JDR) Script for Windows
  4. rem -------------------------------------------------------------------------
  5. rem
  6. rem This script creates a JDR report containing useful information for
  7. rem diagnosing problems with the application server. The report consists
  8. rem of a zip file containing log files, configuration, a list of all files
  9. rem in the distribution and, if available, runtime metrics.
  10. rem $Id$
  11. @if not "%ECHO%" == "" echo %ECHO%
  12. @if "%OS%" == "Windows_NT" setlocal
  13. if "%OS%" == "Windows_NT" (
  14. set "DIRNAME=%~dp0%"
  15. ) else (
  16. set DIRNAME=.\
  17. )
  18. pushd %DIRNAME%..
  19. set "RESOLVED_JBOSS_HOME=%CD%"
  20. popd
  21. if "x%JBOSS_HOME%" == "x" (
  22. set "JBOSS_HOME=%RESOLVED_JBOSS_HOME%"
  23. )
  24. pushd "%JBOSS_HOME%"
  25. set "SANITIZED_JBOSS_HOME=%CD%"
  26. popd
  27. if "%RESOLVED_JBOSS_HOME%" NEQ "%SANITIZED_JBOSS_HOME%" (
  28. echo WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.
  29. )
  30. set DIRNAME=
  31. if "%OS%" == "Windows_NT" (
  32. set "PROGNAME=%~nx0%"
  33. ) else (
  34. set "PROGNAME=jdr.bat"
  35. )
  36. rem Setup JBoss specific properties
  37. if "x%JAVA_HOME%" == "x" (
  38. set JAVA=java
  39. echo JAVA_HOME is not set. Unexpected results may occur.
  40. echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
  41. ) else (
  42. set "JAVA=%JAVA_HOME%\bin\java"
  43. )
  44. rem Find jboss-modules.jar, or we can't continue
  45. if exist "%JBOSS_HOME%\jboss-modules.jar" (
  46. set "RUNJAR=%JBOSS_HOME%\jboss-modules.jar"
  47. ) else (
  48. echo Could not locate "%JBOSS_HOME%\jboss-modules.jar".
  49. echo Please check that you are in the bin directory when running this script.
  50. goto END
  51. )
  52. rem Setup JBoss specific properties
  53. rem Setup the java endorsed dirs
  54. set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed
  55. rem Set default module root paths
  56. if "x%JBOSS_MODULEPATH%" == "x" (
  57. set "JBOSS_MODULEPATH=%JBOSS_HOME%\modules"
  58. )
  59. "%JAVA%" ^
  60. -Djboss.home.dir="%JBOSS_HOME%" ^
  61. -jar "%JBOSS_HOME%\jboss-modules.jar" ^
  62. -mp "%JBOSS_MODULEPATH%" ^
  63. org.jboss.as.jdr ^
  64. %*