4 Replies Latest reply on Mar 2, 2009 1:00 AM by parag.goyal

    Starting JBoss as a Service on Windows XP has an issue

    parag.goyal

      Hi All,
      I have installed JBoss4.2.2 as a service on Windows XP . So that we can start or stop JBoss AS as a window service. I faced problem that whenever trailing backslash ("\") appears at the end of value of PATH (PATH in "system variables" not in "user variables")

      For e.g.

      PATH =%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\MSSQL7\BINN;C:\PROGRA~1\ULTRAE~1;C:\Program Files\CA\Unicenter Software Delivery\BIN;C:\Lang\JProbe 7.0\bin\


      JBoss will not start as a windows service.

      As per my observation its a bug of service wrapper of JBoss4.2.2 "jbosssvc.exe"


      JBoss 4.2.2 AS starts well as a service if value of PATH( system variable) is without backslash "\" at the end.

      like below :

      PATH =%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\MSSQL7\BINN;C:\PROGRA~1\ULTRAE~1;C:\Program Files\CA\Unicenter Software Delivery\BIN;C:\Lang\JProbe 7.0\bin

      Run.log is shown below when JBoss 4.2.2 AS is not able to start as a service:

      Please help me to fix this issue,if there is any other solution please suggest me.

      Thanks in Advance

      Parag Goyal


      ===============================================================================
      
       JBoss Bootstrap Environment
      
       JBOSS_HOME: C:\Lang\JBoss\jboss-4.2.2.GA
      
       JAVA: C:\Lang\Java\jdk1.6.0_03\bin\java
      
       JAVA_OPTS: -Djava.library.path="C:\Lang\JBoss\jboss-4.2.2.GA\bin\native;C:\Program Files\CA\Dcs\DMScripting\;C:\Program Files\CA\DCS\CAWIN\;C:\Program Files\MKS\IntegrityClient\bin;C:\Lang\MKS\IntegrityClient\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\MSSQL7\BINN;C:\PROGRA~1\ULTRAE~1;C:\Program Files\CA\Unicenter Software Delivery\BIN;C:\Lang\JProbe 7.0\bin\" -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
      
       CLASSPATH: C:\Lang\Java\jdk1.6.0_03\lib\tools.jar;C:\Lang\JBoss\jboss-4.2.2.GA\bin\run.jar
      
      ===============================================================================
      
      Usage: java [-options] class [args...]
       (to execute a class)
       or java [-options] -jar jarfile [args...]
       (to execute a jar file)
      
      where options include:
       -client to select the "client" VM
       -server to select the "server" VM
       -hotspot is a synonym for the "client" VM [deprecated]
       The default VM is client.
      
       -cp <class search path of directories and zip/jar files>
       -classpath <class search path of directories and zip/jar files>
       A ; separated list of directories, JAR archives,
       and ZIP archives to search for class files.
       -D<name>=<value>
       set a system property
       -verbose[:class|gc|jni]
       enable verbose output
       -version print product version and exit
       -version:<value>
       require the specified version to run
       -showversion print product version and continue
       -jre-restrict-search | -jre-no-restrict-search
       include/exclude user private JREs in the version search
       -? -help print this help message
       -X print help on non-standard options
       -ea[:<packagename>...|:<classname>]
       -enableassertions[:<packagename>...|:<classname>]
       enable assertions
       -da[:<packagename>...|:<classname>]
       -disableassertions[:<packagename>...|:<classname>]
       disable assertions
       -esa | -enablesystemassertions
       enable system assertions
       -dsa | -disablesystemassertions
       disable system assertions
       -agentlib:<libname>[=<options>]
       load native agent library <libname>, e.g. -agentlib:hprof
       see also, -agentlib:jdwp=help and -agentlib:hprof=help
       -agentpath:<pathname>[=<options>]
       load native agent library by full pathname
       -javaagent:<jarpath>[=<options>]
       load Java programming language agent, see java.lang.instrument
       -splash:<imagepath>
       show splash screen with specified image


        • 1. Re: Starting JBoss as a Service on Windows XP has an issue
          dimitris

          Why not just fixing your path?

          Either remove the trailing slash, or change the order so that it doesn't appear last (C:\Lang\JProbe 7.0\bin\).

          I guess the problem is that the trailing slash followed by '"' escapes the double quote in JAVA_OPTS thus breaking the command line.

          • 2. Re: Starting JBoss as a Service on Windows XP has an issue
            parag.goyal

            You are right,
            In our development evoirnment we are working like this way only as you are suggesting .we are just removing the trailing slash.This is also true it is affecting JAVA_OPTS. But how is breaking command line i still could't understand.

            Main problem is in our production envoirment where customer can be confused because of path problem(If they have installed some software which leave path with trailing back slash).That is why we are looking some other alternative(other than jbosssvc.exe of JBoss 4.2.2 AS) to install/start/stop/uninstall JBoss as a service on windows.

            Even i am able to intall JBoss as a service succes SC.exe utility of windows with command as given below .

            sc config JBAS42SVE displayname= "JBoss Application Server 4.32" binpath= "C:\Lang\JBoss\jboss-4.2.2.GA\bin\service.bat" type= own start= auto depend= afd/tcpip .

            By this way service is avaiable at Service Controller Page of windows XP .But now i am not able to start service its showing error 1053.

            please tell me some alternative way to create JBoss window service.


            parag

            • 3. Re: Starting JBoss as a Service on Windows XP has an issue
              mladen.turk

              The problem is not in service but rather in run.bat
              The reason why it is observed when running as service is because the
              service mode uses system PATH environment variable
              (which probably ends wit backslash)

              The fix is easy. Inside run.bat change:

              REM Add bin/native to the PATH if present
              if exist "%JBOSS_HOME%\bin\native" set PATH=%JBOSS_HOME%\bin\native;%PATH%

              To:

              REM Add bin/native to the PATH if present
              if exist "%JBOSS_HOME%\bin\native" set PATH=%JBOSS_HOME%\bin\native;%PATH%;%JBOSS_HOME%\bin


              Regards,
              Mladen

              • 4. Re: Starting JBoss as a Service on Windows XP has an issue
                parag.goyal

                Hi Mladen,

                Thanks for the solution

                Replacing

                REM Add bin/native to the PATH if present
                if exist "%JBOSS_HOME%\bin\native" set PATH=%JBOSS_HOME%\bin\native;%PATH%

                with(As you suggested work well , Hence JBoss is able to start as a service)

                REM Add bin/native to the PATH if present
                if exist "%JBOSS_HOME%\bin\native" set PATH=%JBOSS_HOME%\bin\native;%PATH%;%JBOSS_HOME%\bin

                More over it is able to start with below given 2 replacements .

                1 .
                REM Add bin/native to the PATH if present
                if exist "%JBOSS_HOME%\bin\native" set PATH=%PATH%;%JBOSS_HOME%\bin\native;(%PATH% is prefixed instead of postfix)

                2.
                REM Add bin/native to the PATH if present
                if exist "%JBOSS_HOME%\bin\native" set PATH=%JBOSS_HOME%\bin\native;%PATH%;(only semicolor is added at the end of path)

                do u think will there be any problem due these 2 alternatives.

                One more think .
                I could not understand why it is the problem of run.bat why not jbosssvc.exe ? Becuase i am able to run JBoss AS from run.bat directly any how with or without trailing slash at last of PATH enviornment variable but problem encountered only when we run JBoss as a service(which uses jbosssvc.exe).

                Thaks,
                parag