10 Replies Latest reply on Nov 26, 2010 10:36 AM by tess

    Running Jboss As Windows Service

      Hi,

      I need to run the jboss server as a windows service. To achieve that i used Native JBoss. I am able to run it as a windows service using that but i can access jboss only on localhost. I need to run jboss on a specific ipadress. It can be done by few changes in the service.bat file.


      This is the snippet of service.bat file:

      :cmdStart
      REM Executed on service start
      call run.bat >run.log
      goto cmdEnd

      ipaddress has to be added in the service.bat file in the above code in the line: call run.bat >run.log

      Similarly should i have to add the ipaddress even during shutdown in the code:

      :cmdStop
      REM Executed on service stop
      call shutdown -S >shutdown.log
      goto cmdEnd


      I dont exactly remember how to add that ip address.

      waiting for reply from someone.....!

      Thanks in advance...

      Regards,
      Raghav.

        • 1. Re: Running Jboss As Windows Service

          This is the continuation of my previous post..
          I would like to run jboss on 0.0.0.0 instead of some specific ip address.

          Thanks..

          • 2. Re: Running Jboss As Windows Service
            jaikiran

            You can do this:

            :cmdStart
            REM Executed on service start
            call run.bat -b 0.0.0.0 >run.log
            goto cmdEnd


            • 3. Re: Running Jboss As Windows Service
              dimitris

              FYI, I've included the windows Service Runner binary (jbossvc.exe) from jboss native in the bin directory, by default now:

              https://jira.jboss.org/jira/browse/JBAS-5234

              • 4. Re: Running Jboss As Windows Service
                jaikiran

                 

                "dimitris@jboss.org" wrote:
                FYI, I've included the windows Service Runner binary (jbossvc.exe) from jboss native in the bin directory, by default now:

                https://jira.jboss.org/jira/browse/JBAS-5234


                As far as i remember, the JBoss Native has hardware specific (32 bit and 64 bit) downloads. And going by the JIRA comments (readme), it looks like only the 32 bit version is by default packaged with the JBoss-AS (which is platform independent).
                So if the AS has to be installed on a 64 bit Windows, the user will have to separately download the JBoss Native 64 bit, as is being done currently, isn't it?


                • 5. Re: Running Jboss As Windows Service
                  jaikiran

                   

                  "jaikiran" wrote:
                  going by the JIRA comments (readme), it looks like only the 32 bit version is by default packaged with the JBoss-AS


                  The readme part in the JIRA actually confused me:

                  With a note on the header of README-service.txt:
                  ---------------------------------------------------------------------
                  README-service.txt, service.bat and jbosssvc.exe are part of the
                  'JBoss Native Win32' distribution. They are included here to allow
                  JBossAS run as a Service in Windows environments.

                  The version used is 'JBoss Native 2.0.6 Win32'


                  However, it looks like care has been taken to make the service work on even 64 bit systems :-) A comment from the same JIRA:


                  4. Allow paralell native installations and use the one corresponding to the JVM used and host CPU. If we are on the 64-bit system detect if the JVM is 64 or 32 bit (reported from java -version) and construct the path to the native according to that. This allows a single native binary for windows that has multiple CPU builds.


                  • 6. Re: Running Jboss As Windows Service
                    slaboure

                    Look at here: http://www.jboss.org/community/docs/DOC-11932

                    Option 1 is the one which will be made available by default in JBoss AS 5.0 GA

                    • 7. Re: Running Jboss As Windows Service
                      dimitris

                      Mladen told me it should work on both 32 and 64 bit windows platforms.

                      You can try it, too, on x64 and tell me if there is any problem :-)

                      I thought it would be very useful to bundle this by default to avoid all the hassle of reverting to service wrappers and the like.

                      If someone wants the full jboss native distro to get the apr connectors and stuff you can simply unzip it over.

                      • 8. Re: Running Jboss As Windows Service
                        jaikiran

                         

                        "dimitris@jboss.org" wrote:


                        You can try it, too, on x64 and tell me if there is any problem :-)


                        Sure.

                        "dimitris@jboss.org" wrote:

                        I thought it would be very useful to bundle this by default to avoid all the hassle of reverting to service wrappers and the like.


                        Definitely useful :-)


                        • 9. Re: Running Jboss As Windows Service
                          peterj

                          I just now downloaded trunk and tried using the included jbosssvc.exe on my Vista 64-bit box and got a C0000005 access violation error. This error does not appear if I use the jbosssvc.exe from the 64-bit Windows JBoss Native download.

                          Perhaps provide both jbosssvc.exe and jbosssvc64.exe, and update the service.bat script to detect which is required and use the right one. You can key off of the PROCESSOR_ARCHITECTURE env var, it is set to "x86" when running 32-bit Windows and "AMD64" for 64-bit Windows. (Note that I have an Intel Core 2 Quad processor - thus "AMD64" does not really identify the exact processor type, but rather simply means "running a 64-bit OS".)

                          • 10. Re: Running Jboss As Windows Service
                            tess

                            Hi,

                             

                             

                            I have resolved the problem by changing service.bat  with

                            :cmdStart
                            REM Executed on service start
                            call run.bat -b 0.0.0.0 >run.log
                            goto cmdEnd

                            as specified by jaikiran pai    .Thank you.