4 Replies Latest reply on Jan 26, 2006 3:15 PM by David Roossien

    JBossMQ as Windows Service

    David Roossien Newbie

      I have installed a minimal JBoss server for running JMS. Now I would like to run it as a Windows Service.

      I have followed the instructions here:

      http://wiki.jboss.org/wiki/Wiki.jsp?page=JavaService

      But, when I execute the command

      JBossService.exe -install JBoss {JDK_HOME}\jre\bin\{hotspot|server|classic}\jvm.dll -D java.class.path={JDK_HOME}\lib\tools.jar;{JBOSS_BIN}\run.jar -start org.jboss.Main -stop org.jboss.Main -method systemExit -out {JBOSS_BIN}\stdout.log -err {JBOSS_BIN}\stderr.log -current {JBOSS_BIN} -depends mysql -manual -overwrite

      I get:

      Insufficient parameters to install service (jvm -start class)
      JavaService install command parameters not valid, or incomplete'server' is not recognized as an internal or external command,
      operable program or batch file.

      D:\ProgramFiles\jboss-4.0.3SP1\bin>

      When I look in run.jar, I see that there is a Main.class, which should be found with the classpath org.jboss.Main.

      I don't know what is wrong. Thanks for any help you can provide!

      David

        • 1. Re: JBossMQ as Windows Service
          David Roossien Newbie

          I took this command from the InstallJBoss.bat file and filled in my own variables.

          "%jbossexe%" -install JBoss "%jvmdll%" -Djava.class.path="%jbossjar%;%toolsjar%" -Xms64M -Xmx128M -start org.jboss.Main -stop org.jboss.Main -method systemExit -out "%JBOSS_HOME%\bin\out.log" -err "%JBOSS_HOME%\bin\err.log" -current "%JBOSS_HOME%\bin" %dependopt% %svcmode% -overwrite -startup 6

          Here is the command with my variables:

          JBossService.exe -install JBossJMS %JAVA_HOME%\jre\bin\server\jvm.dll -Djava.class.path="%JBOSS_HOME%\bin\run.jar;%JAVA_HOME%\lib\tools.jar" -Xms64M -Xmx128M -start org.jboss.Main -stop org.jboss.Main -method systemExit -out "%JBOSS_HOME%\bin\out.log" -err "%JBOSS_HOME%\bin\err.log" -current "%JBOSS_HOME%\bin" -depends mysql -manual -overwrite

          I get:

          The JBoss manual service was successfully installed, depends on mysql service.

          This is progress...

          However, when I run the Service in Windows it says that the Service started and then stopped. I assume this is because of the dependency on mysql, which I don't have installed. Maybe the full JBoss AS includes mysql, but the minimal JBossMQ installation does not. I don't know....

          Thanks for any help you can provide!

          • 2. Re: JBossMQ as Windows Service
            David Roossien Newbie

            Sorry, that last post was not accurate.

            When I try to run the Service, I get an error

            Error: 1075 The dependency serivce does not exist or is marked for deletion.

            If I remove "-depends mysql" from the command, then the service starts and stops, I assume because mysql doesn't exist on my computer.

            • 3. Re: JBossMQ as Windows Service
              David Roossien Newbie

              I have now installed MySQL, but still cannot start the service.

              Here are the commands I used:

              D:\ProgramFiles\jboss-4.0.3SP1\bin>set JbossPath=D:\ProgramFiles\jboss-4.0.3SP1

              D:\ProgramFiles\jboss-4.0.3SP1\bin>set javaPath=C:\Program Files\Java\jdk1.5.0_05

              D:\ProgramFiles\jboss-4.0.3SP1\bin>set cp=%javaPath%\lib\tools.jar;.\run.jar;.\myRes.jar

              D:\ProgramFiles\jboss-4.0.3SP1\bin>JavaService.exe -install JBdaver "%javaPath%\jre\bin\client\jvm.dll" -Xms256m -Xmx1024m -Xincgc -Djava.class.path=%cp% -Dprogram.name=run.bat -start org.jboss.Main -stop org.jboss.Shutdown -out %JbossPath%\stdout.log -err %JbossPath%\stderr.log -current %JbossPath% -depends mysql -auto
              The JBdaver automatic service was successfully installed, depends on mysql service.

              D:\ProgramFiles\jboss-4.0.3SP1\bin>net start JBdaver
              The JBdaver service is starting.
              The JBdaver service could not be started.

              The service did not report an error.

              More help is available by typing NET HELPMSG 3534.


              D:\ProgramFiles\jboss-4.0.3SP1\bin>@ECHO
              ECHO is on.

              D:\ProgramFiles\jboss-4.0.3SP1\bin>net start JBdaver
              The JBdaver service is starting.
              The JBdaver service could not be started.

              The service did not report an error.

              More help is available by typing NET HELPMSG 3534.


              D:\ProgramFiles\jboss-4.0.3SP1\bin>

              • 4. Re: JBossMQ as Windows Service
                David Roossien Newbie

                I did get this to work using the following:

                1. You will need to install MySQL before attempting this.

                2. Extract JavaService-2.0.9.zip in a temp directory.

                3. copy JavaService.exe %SystemRoot%\system32\JavaService.exe

                4. Run the following:

                JavaService -install JBossJMS "%JAVA_HOME%\jre\bin\client\jvm.dll" -Xms128m -Xmx512m -Xincgc -Djava.class.path="C:\Program Files\Java\jdk1.5.0_05\lib\tools.jar;D:\ProgramFiles\jboss-4.0.3SP1\bin\run.jar" -Dprogram.name=run.bat -start org.jboss.Main -stop org.jboss.Shutdown -out %JBOSS_HOME%\stdout.log -err %JBOSS_HOME%\stderr.log -current %JBOSS_HOME% -depends mysql -auto

                5. Use Windows Services to start, or start with "net start JBossJMS"