0 Replies Latest reply on Nov 21, 2006 2:23 PM by Zachary Yadamec

    Jboss Service

    Zachary Yadamec Newbie

      So i am a in ops and just recentally I was informed that I could nolonger run our JBOSS application servers as a console due to security concerns of not logging out of the servers. I am looking into Java Service Wrapper and Java as a Service for a solution to this problem. I am running into issues with the complexity of the install and translating it into config files for eather of the programs. All I am really looking for is a point in the right direction so managment will stop bugging me. At the bottom I have attached the startup batch file. Also note that it has a 8GB max heap size, and yes it does use it.

      Server Specs
      Win2k3 Standard X64
      2X 3GHz Xeon
      Java 1.5.0_08
      Jboss 404(I will be also doing this later on for a 401 install)16 GB ram

      [CODE]
      @echo off
      @rem
      @rem last updated: 10/07/2004
      @rem
      @rem This script gets generated by substituting the parameters such as
      @rem JAVA_HOME, JBOSS_HOME, from the properties set in
      @rem {CONFIG_BSE}/config.properties or default.properties
      @rem
      @rem Usage:
      @rem startJboss
      @rem
      echo off

      rem $Id: startJboss.bat,v 1.1.2.11.4.2 2005/12/14 11:50:18 suthakar Exp $

      @if not "%ECHO%" == "" echo %ECHO%
      @if "%OS%" == "Windows_NT" setlocal

      set DIRNAME=.\
      if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
      set PROGNAME=startJboss.bat
      if "%OS%" == "Windows_NT" set PROGNAME=%~nx0%

      rem Read all command line arguments

      REM
      REM The %ARGS% env variable commented out in favor of using %* to include
      REM all args in java command line. See bug #840239. [jpl]
      REM
      REM set ARGS=
      REM :loop
      REM if [%1] == [] goto endloop
      REM set ARGS=%ARGS% %1
      REM shift
      REM goto loop
      REM :endloop


      set JBOSS_SYSTEM_HOME=E:\Programs\jboss-4.0.1RC2

      set JAVA_HOME=E:/Programs/Java/jdk1.5.0_08

      set APP1_HOME=E:\App\EV08_PA

      set JBOSS_JVM_DEBUGPARAMS=
      set JBOSS_JVM_EXTRAPARAMS=

      set JBOSS_MAX_HEAPSIZE=2048m
      set JBOSS_MIN_HEAPSIZE=2048m

      REM Find run.jar, or we can't continue
      set RUNJAR=%JBOSS_SYSTEM_HOME%\bin\run.jar

      if exist "%RUNJAR%" goto FOUND_RUN_JAR
      echo Could not locate %RUNJAR%. Please check that you are in the
      echo bin directory when running this script.
      goto END

      :FOUND_RUN_JAR


      @REM ORACLE_DRIVER_TYPE should be thin8 or thin9 or oci8
      set ORACLE_DRIVER_TYPE=ojdbc14

      @REM DB_DATAMART_CONNECTIONTYPE should be ORACLE or SQLSERVER, ORACLE is default
      set DB_DATAMART_CONNECTIONTYPE=ORACLE

      set OPTIT_ENABLE=false
      @REM set it to 0 to enable memory profiler.
      set OPTIT_DISABLE_MEMORY_PROFILER=1

      @REM
      @REM ALL the INPUT PARAMETER OVERRIDES ARE DONE AT THIS POINT.
      @REM

      if "%ORACLE_DRIVER_TYPE%"=="oci8" goto set_oci8_driver
      if "%ORACLE_DRIVER_TYPE%"=="oci9" goto set_oci9_driver
      if "%ORACLE_DRIVER_TYPE%"=="thin9" goto set_thin9_driver

      @REM Default ORACLE_DRIVER_TYPE value is assumed to be thin8.
      @REM Set to thin8 driver
      set JDBC_CLASSPATH=%APP1_HOME%\3rdparty\classes\oracle8i_12.jar
      goto set_oracle_driver_done

      :set_oci8_driver
      @REM Set to oci8 driver
      set JDBC_CLASSPATH=%APP1_HOME%\3rdparty\classes\oracle8i_oci12.zip
      set PATH=%APP1_HOME%\3rdparty\classes;%PATH%
      goto set_oracle_driver_done

      :set_oci9_driver
      @REM Set to oci9 driver
      set JDBC_CLASSPATH=E:/Programs/Oracle/ora92/jdbc/lib/ojdbc14.jar
      set PATH=%APP1_HOME%\3rdparty\classes;%PATH%
      goto set_oracle_driver_done

      :set_thin9_driver
      @REM Set to thin9 driver
      set JDBC_CLASSPATH=E:/Programs/Oracle/ora92/jdbc/lib/ojdbc14.jar

      :set_oracle_driver_done

      set APP1_BOOTPATH=
      set APP1_BOOTPATH=%APP1_BOOTPATH%;%APP1_HOME%\3rdparty\classes\xmlParserAPIs.jar
      set APP1_BOOTPATH=%APP1_BOOTPATH%;%APP1_HOME%\3rdparty\classes\xercesImpl.jar
      set APP1_BOOTPATH=%APP1_BOOTPATH%;%APP1_HOME%\3rdparty\classes\xalan.jar
      SET XBOOTPATH=-Xbootclasspath/p:"%APP1_BOOTPATH%"

      if not "%DB_DATAMART_CONNECTIONTYPE%" == "SQLSERVER" goto set_APP1_classpath
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\apps\sqlserver\msbase.jar;
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\apps\sqlserver\msutil.jar;
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\apps\sqlserver\mssqlserver.jar;

      :set_APP1_classpath

      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\jasperreports.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\bizconnector.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\jaxp-api.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\pullparser.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\oreilly.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\htmltidy.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\mail.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\soap.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\log4j.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\jakarta-oro-2.0.7.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\commons-httpclient-2.0-rc3.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\junit.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\aspectjrt-1.1.1.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;E:/Programs/Oracle/ora92/jdbc/lib/ojdbc14.jar

      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\activation.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\bsh-1.3.0.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\commons-beanutils-1.5.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\commons-collections-2.1.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\commons-fileupload-1.0.jar

      REM
      REM In APP1 3rdparty we have earlier version of these two jar files. But, JBoss requires the latest version.
      REM Directly refering the jboss home folder.
      REM

      set APP1_CLASSPATH=%APP1_CLASSPATH%;%JBOSS_HOME%\server\default\deploy\jbossweb-tomcat50.sar\commons-digester.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%JBOSS_HOME%\server\default\deploy\jbossweb-tomcat50.sar\commons-logging.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%JBOSS_HOME%\server\default\lib\javax.servlet.jar

      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\itext-1.01.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\iReport-0.4.0.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\jfreechart-0.9.21.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\jcommon-0.9.6.jar
      set APP1_CLASSPATH=%APP1_CLASSPATH%;%APP1_HOME%\3rdparty\classes\poi-2.5.1-final-20040804.jar


      if not "%JAVA_HOME%" == "" goto ADD_TOOLS

      set JAVA=java

      echo JAVA_HOME is not set. Unexpected results may occur.
      echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
      goto SKIP_TOOLS

      :ADD_TOOLS

      set JAVA=%JAVA_HOME%\bin\java

      if exist "%JAVA_HOME%\..\lib\tools.jar" goto SKIP_TOOLS
      echo Could not locate %JAVA_HOME%\lib\tools.jar. Unexpected results may occur.
      echo Make sure that JAVA_HOME points to a JDK and not a JRE.

      :SKIP_TOOLS

      rem Include the JDK javac compiler for JSP pages. The default is for a Sun JDK
      rem compatible distribution to which JAVA_HOME points

      set JAVAC_JAR=%JAVA_HOME%\..\lib\tools.jar;%JAVA_HOME%\lib\tools.jar

      rem If JBOSS_CLASSPATH is empty, don't include it, as this will
      rem result in including the local directory, which makes error tracking
      rem harder.
      if "%JBOSS_CLASSPATH%" == "" (
      set JBOSS_CLASSPATH=%JAVAC_JAR%;%RUNJAR%
      ) ELSE (
      set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%JAVAC_JAR%;%RUNJAR%;
      )

      rem APP1 home settings

      if "%1"=="debug" set DEBUG_ENABLE=true

      if "%DEBUG_ENABLE%"=="true" goto processDebug
      goto processDebugDone
      :processDebug
      set JAVA_OPTS=%JAVA_OPTS% %JBOSS_JVM_DEBUGPARAMS%
      :processDebugDone

      set JAVA_HEAP=

      if "%JBOSS_MIN_HEAPSIZE%"=="" goto jbossDefaultMinHeap
      set JAVA_HEAP=-Xms%JBOSS_MIN_HEAPSIZE%
      goto jbossMinHeapDone
      :jbossDefaultMinHeap
      set JAVA_HEAP=-Xms64m
      :jbossMinHeapDone

      if "%JBOSS_MAX_HEAPSIZE%"=="" goto jbossDefaultMaxHeap
      set JAVA_HEAP=%JAVA_HEAP% -Xmx%JBOSS_MAX_HEAPSIZE%
      goto jbossMaxHeapDone
      :jbossDefaultMaxHeap
      set JAVA_HEAP=%JAVA_HEAP% -Xmx500m
      :jbossMaxHeapDone


      rem JBoss settings
      set CLASSPATH=%JBOSS_CLASSPATH%;%APP1_CLASSPATH%

      rem Setup JBoss specific properties
      set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME% -Dfile.encoding=UTF-8
      set JAVA_OPTS=%JAVA_OPTS% -Dvr2m.log4j.config.file=/web/app/WEB-INF/meta/system/config/logging.xml

      set JAVA_OPTS=%JAVA_HEAP% %JAVA_OPTS% %JBOSS_JVM_EXTRAPARAMS%

      rem set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m
      rem set JAVA_OPTS=%JAVA_OPTS% -Djava.security.debug=help

      rem Sun JVM memory allocation pool parameters. Uncomment and modify as appropriate.
      rem set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m

      rem JPDA options. Uncomment and modify as appropriate to enable remote debugging.
      rem set JAVA_OPTS=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%

      rem Setup the java endorsed dirs
      set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed

      echo ===============================================================================
      echo .
      echo JBoss Bootstrap Environment
      echo .
      echo JBOSS_HOME: %JBOSS_SYSTEM_HOME%
      echo .
      echo JAVA: %JAVA%
      echo .
      echo JAVA_OPTS: %JAVA_OPTS%
      echo .
      echo CLASSPATH: %CLASSPATH%
      echo .
      echo .
      echo APP1: %APP1_HOME%
      echo .
      echo ===============================================================================
      echo .

      :RESTART
      echo on
      "%JAVA%" -hotspot %JAVA_OPTS% -Djava.endorsed.dirs=%JBOSS_ENDORSED_DIRS% -classpath "%CLASSPATH%" -Djboss.server.config.url="file:/%APP1_HOME%\jboss_home\config\APP1\conf" org.jboss.Main -c default %*
      IF ERRORLEVEL 10 GOTO RESTART

      :END

      [/CODE]