10 Replies Latest reply on Jul 30, 2016 12:58 AM by pcouas

    Running jboss EAP 6.1 as service in Windows

    luckybit

      I downloaded and installed EAP 6.1 I can start it as an application on Windows running standalone.bat, but how can I run EAP as a service?

      Inside the bin directory i dont see any service.bat script as stated in the installation guide.

      Thanks

        • 1. Re: Running jboss EAP 6.1 as service in Windows
          jaikiran

          Leonardo, welcome to the forums!

           

          Leonardo Berti wrote:

           

           

          Inside the bin directory i dont see any service.bat script as stated in the installation guide.

           

          I am looking at the installation guide here https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.1/html/Installation_Guide/index.html and I don't see where it mentions that. Do you have a link where it mentions the service.bat?

          • 2. Re: Running jboss EAP 6.1 as service in Windows
            jaikiran

            As for the original question, here's a bugzilla discussion which has a service.bat for running EAP 6 as a service on Windows https://bugzilla.redhat.com/show_bug.cgi?id=732889

            • 3. Re: Running jboss EAP 6.1 as service in Windows
              nav

              Cannot see the bugzilla discussion, it's asking to log into bugzilla first...

               

              I need to add EAP 6.1 as a windows service as well, anyone have a guide?

               

              Thanks.

              • 4. Re: Running jboss EAP 6.1 as service in Windows
                jaikiran

                Navanga Wanigatunga wrote:

                 

                Cannot see the bugzilla discussion, it's asking to log into bugzilla first...

                 

                Thank you for letting us know about that. Please try accessing that bugzilla now, it should be viewable without an account.

                 

                Read through the comments for an answer to your original question.

                • 5. Re: Running jboss EAP 6.1 as service in Windows
                  sbeaver123

                  I've got JBoss EAP 6.1.0 running as a Windows service, after some research, so here are my instructions. I hope you find them helpful. Note that they only work for the standalone server at the moment, you'd need to make some changes to the batch files for a domain service. It may be that there are better ways to do this, but this approach works for me.

                   

                  The starting point for me was this bug:

                   

                  https://bugzilla.redhat.com/show_bug.cgi?id=918199

                   

                  Most of what follows is lifted from this bug, which seems to cover most of the same ground as the one Jaikiran mentioned, although I've added a couple of further customisation options.

                   

                  In order to run JBoss as a Windows service you need components from the Apache Commons Daemon project combined with a couple of batch files. These all go in %JBOSS_HOME%\modules\native\sbin, where %JBOSS_HOME% is the directory in which you've installed JBoss.

                   

                  The relevant part of Commons Daemon is called procrun, and it can be found here:

                   

                  http://commons.apache.org/proper/commons-daemon/procrun.html

                   

                  You need a copy of the main procrun jar file, and a binary file called prunsrv.exe. You get this by following the Native Binaries link on the page above. You just need to pick either a 32bit or 64bit version, to match the machine you are running on. (There is technically a third option for Intel Itanium, but most people will be able to ignore that.)

                   

                  The Bugzilla that I mentioned above uses a patched version of the procrun jar. However I discovered that the patch in question has actually been applied to the later versions of procrun. I am running with the standard version 1.0.15 procrun jar without any problems.

                   

                  In addition to the procrun jar and the prunsrv.exe binary, there are two batch files you need to create the service. There is service.bat which actually creates the service, and service.conf.bat which contains configuration information that configures the service. I took these from the bug I mentioned, but I'm attaching my custom variants since I've added a couple of features people may find useful.

                   

                  service.conf.bat sets up a number of variables which affect how the service is configured. Of particular interest are:

                   

                  PROCRUN_JAR - The name of the procrun jar file, which typically will include the version number. e.g. common-daemon-1.0.15.jar

                  SERVICE_NAME - This is the internal name for the Windows service. This is used when you want to control the service using Windows commands such as 'sc'.

                  SERVICE_DISP - This is the display name of the service, which is shown when you view it in the Services application from the Windows Control Panel.

                  SERVICE_DESC - This is the long description of the service, as used in the Services application.

                  EAP_SERVER_CONFIG - The configuration file to pass to the service. This allows you to configure the service to use clustering and other profile options.

                  SERVICE_STARTUP_MODE - Allows you to specify whether the Windows service you create should start automatically or require a manual start. Valid values are 'auto' and 'manual' respectively.

                   

                  So with all this created, you should now have a directory called %JBOSS_HOME%\modules\native\sbin which contains something like:

                  common-daemon-1.0.15.jar

                  prunsrv.exe

                  service.conf.bat

                  service.bat

                   

                  To install JBoss as a Windows service, just go to the sbin directory and run

                   

                  service.bat install

                   

                  If all goes well, you should then be able to start the Windows service in the usual ways.

                  1 of 1 people found this helpful
                  • 6. Re: Running jboss EAP 6.1 as service in Windows
                    luckybit

                    Thank u sbeaver123 it works!

                    Your instructions are what i was looking for.Thank u so much for your help.

                    • 7. Re: Running jboss EAP 6.1 as service in Windows
                      s.horn

                      For Jboss 7.1.1 i used the jbosssvc.exe and the service.bat from Jboss Web Native Connectors:

                       

                      http://www.jboss.org/jbossweb/downloads/jboss-native-2-0-10

                       

                      All you need is to copy the jbosssvc.exe and the service.bat to bin directory.

                      After that you must edit the service.bat to use standalone.bat instead of run.bat for startup

                      and call jboss-cli.bat --connect --command=:shutdown instead of shutdown.bat

                      • 8. Re: Running jboss EAP 6.1 as service in Windows
                        sharad7879

                        I am not able to locate below mentioned directory on my installed Jboss 6.1 path, Please let me know if this needs to be manually created.

                         

                        %JBOSS_HOME%\modules\native\sbin

                        • 9. Re: Running jboss EAP 6.1 as service in Windows
                          ybxiang.china
                          • 10. Re: Running jboss EAP 6.1 as service in Windows
                            pcouas

                            Hi

                             

                            I have same problem with JBOSS 6.4.8 EAP

                            I could install service, but it doesn't running and i have no Jboss Log

                            I could launch jboss manualy with standaline.bat

                            Windows event says "Incorrect function "

                             

                            Regards

                            Phil