1 2 Previous Next 17 Replies Latest reply on May 24, 2016 6:56 AM by nickarls

    WildFly 8 service does not stop on Windows 2012 R2 core

    hpillai

      Wildfly 8 final installed on Windows 2012 R2 server core OS.

      Java JRE server 64 bit version 1.7.0_51 installed on d:\Java\jdk1.7.0_51

      http://www.oracle.com/technetwork/java/javase/downloads/server-jre7-downloads-1931105.html

      Environment variables and path statement:

      JAVA_HOME=D:\Java\jdk1.7.0_51
      JBOSS_HOME=D:\wildfly-8-Final
      JRE_HOME=D:\Java\jdk1.7.0_51\jre
      Path=D:\Java\jdk1.7.0_51\jre\bin;D:\Java\jdk1.7.0_51\bin (appended to the existing values)

       

      Service installed and starts fine using service.bat that comes with Wildfly in D:\Wildfly-8-final\bin\service folder. However cannot stop service using service stop or windows services applet.

      Windows services applet shows the service status as stopping and will show the same till the process is killed. I gave it a day to see if it stops, but it doesnt.


      service stop command shows the following error:
      Using the X86-64bit version of prunsrv
      ERROR: Failed to load service configuration

       

       

      Debug level log reveals the following:

      [2014-03-13 17:12:24] [info]  ( prunsrv.c:687 ) [ 1792] Stopping service ‘Wildfly’ …
      [2014-03-13 17:12:24] [debug] ( prunsrv.c:844 ) [ 2068] reportServiceStatusE: 3, 0, 3000, 0
      [2014-03-13 17:12:24] [info]  ( prunsrv.c:943 ) [ 2000] Stopping service…
      [2014-03-13 17:12:24] [debug] ( prunsrv.c:1057) [ 2000] Waiting for stop worker to finish…
      [2014-03-13 17:12:28] [error] ( prunsrv.c:708 ) [ 1792] Failed to stop ‘Wildfly’ service
      [2014-03-13 17:12:28] [error] ( prunsrv.c:708 ) [ 1792] The data area passed to a system call is too small.
      [2014-03-13 17:12:28] [info]  ( prunsrv.c:716 ) [ 1792] Stop service finished.
      [2014-03-13 17:12:28] [error] ( prunsrv.c:1755) [ 1792] Commons Daemon procrun failed with exit value: 6 (Failed to stop service)
      [2014-03-13 17:12:28] [error] ( prunsrv.c:1755) [ 1792] The data area passed to a system call is too small.
      [2014-03-13 17:12:32] [debug] (rprocess.c:122 ) [ 2504] Child process exit code 0
      [2014-03-13 17:12:32] [debug] ( prunsrv.c:1059) [ 2000] Stop worker finished.
      [2014-03-13 17:12:32] [debug] ( prunsrv.c:844 ) [ 2000] reportServiceStatusE: 3, 0, 300000, 0
      [2014-03-13 17:12:32] [debug] ( prunsrv.c:1093) [ 2000] Waiting for worker to die naturally…

      Any pointers for resolving this is greatly appreciated. Thanks

        • 1. Re: WildFly 8 service does not stop on Windows 2012 R2 core
          angel.ivanov

          I have the same issue on Windows 7 and Windows Server 2003 with Java JRE client 64 bit version 1.7.0_51 installed!

          Please give us some advice ASAP.

          • 2. Re: WildFly 8 service does not stop on Windows 2012 R2 core
            ctomc

            Maybe Mladen Turk has some ideas?

            • 3. Re: WildFly 8 service does not stop on Windows 2012 R2 core
              seafrench

              I had the same(or similar) problem and the following fixed the issue for me:

               

              Given:

              The service is running under a 'Log On' account that is not 'Local System'.

              In my case it was running under an AD account that could connect to an SQL Server database via 'Integrated Security'.

               

              Resolution 1:

              Run the service as Local System.

               

              Resolution 2:

              When installing the service include the user and password options:

              service install /user <user> /password <password>

              Add credentials for service's specified 'Log On' account in the JBOSS_HOME/bin/service/service.bat file.

               

              set JBOSSUSER= <user name here>

              set PASSWORD= <password here>

               

              ---

              I noticed that this issue was added to Jira so I'll add it here in case anyone else lands here:

              Windows service on 64 bit systems cannot be stopped

               

              EDIT:

              Just read the appropriate documentation in the service.bat which states the correct way to get the user and password into the service during the installation:


              in JBOSS_HOME/bin/service/service.bat

               

              echo Usage:

              echo   service install [/controller localhost:9990] [/loglevel INFO] [/host [domainhost]] [/user username /password password]

              echo   service uninstall

              echo   service start

              echo   service stop

              echo   service restart

              echo(

              echo The options for "service install":

              echo   /controller        : the host:port of the domain controller, default: 127.0.0.1:9990

              echo   /loglevel          : the log level for the service:  Error, Info, Warn or Debug ^(Case insensitive^), default: INFO

              echo   /host [domainhost] : indicated domain mode is to be used with an optional domain controller name, default: master

              echo                        Not specifying /host will install in standalone mode

              echo   /user              : username for the shutdown command

              echo   /password          : password for the shutdown command

              echo(

              • 4. Re: WildFly 8 service does not stop on Windows 2012 R2 core
                ctomc

                Thank you!

                This will be useful info for many people.

                • 5. Re: WildFly 8 service does not stop on Windows 2012 R2 core
                  juliusmensing

                  This does not resolve the issue.

                   

                  Operating System: Windows Server 2008 R2 Standard 64bit

                  Wildfly Version: 8.1.0.Final

                  JDK: 1.8 Update 8

                   

                  Installed Service via this command: service.bat install /user Administrator /password ****

                   

                  Startup via "service.bat start" (from command line with administrative priviliges) and Windows Service works fine

                  Stop via "service.bat stop" (from command line with administrative priviliges) and Windows Service does not work:

                  ERROR: Failed to load service configuration

                  Windows Service also displays "Local System" for Log On As.

                  • 6. Re: WildFly 8 service does not stop on Windows 2012 R2 core
                    abhinav.gupta01

                    Both resolution didn't work for me.

                    OS : Windows 7 professional , 64 bit

                     

                    ctomc - Please have a look. Seems something related to 64 bit operating systems.

                    Earlier reported bug - https://issues.jboss.org/browse/WFLY-3149

                    • 7. Re: WildFly 8 service does not stop on Windows 2012 R2 core
                      imantas.majauskas

                      This worked for me:

                      remove "%CREDENTIALS%" from lines 174 and 178 in service.bat file to be like this:

                       

                      174    set STOPPARAM="/c jboss-cli.bat --controller=%CONTROLLER% --connect --command=/host=!DC_HOST!:shutdown"

                      178    set STOPPARAM="/c \"set NOPAUSE=Y ^^^&^^^& jboss-cli.bat --controller=%CONTROLLER% --connect --command=:shutdown\""

                       

                      and reinstall the service.

                      • 8. Re: WildFly 8 service does not stop on Windows 2012 R2 core
                        karthik-vasishta.ramesh

                        Hi All,

                        My colleague & I tried the solution mentioned by Chris French, but this didn't seem to work. but the solution suggested by Imantas Imantas did.

                        Thanks a lot!

                        • 9. Re: WildFly 8 service does not stop on Windows 2012 R2 core
                          jim.lomas

                          Running:

                          • Product - Wildfly 8.2.0
                          • Host - Windows 7 Pro and Win 2012 R2 server
                          • Configuration - Standalone, running default distribution of standalone.xml

                           

                          Symptom:

                          • Wildfly not shutting down
                          • Error 1053: The service did not respond to the start or control request in a timely fashion" error message when you stop or pause a managed Windows service

                           

                          Would just like to offer the following, having suffered the same issue, which may help:

                          At line 172, the distributed service.bat file contains the following block of code.

                           

                          if /I "%IS_DOMAIN%" == "true" (   set STARTPARAM="/c \"set NOPAUSE=Y ^^^&^^^& domain.bat\""   set STOPPARAM="/c jboss-cli.bat --controller=%CONTROLLER% --connect %CREDENTIALS% --command=/host=!DC_HOST!:shutdown"   set LOGPATH=%JBOSS_HOME%\domain\log ) else (   set STARTPARAM="/c \"set NOPAUSE=Y ^^^&^^^& standalone.bat\""   set STOPPARAM="/c \"set NOPAUSE=Y ^^^&^^^& jboss-cli.bat --controller=%CONTROLLER% --connect %CREDENTIALS% --command=:shutdown\""   set LOGPATH=%JBOSS_HOME%\standalone\log )

                           

                          Running jboss-cli.bat in a command console during the point where the service shutdown starts grinding (the point just before you are doomed to a 1053 service shutdown failure)

                          C:\wildfly-8.2.0.Final\bin\service>..\jboss-cli.bat -c --controller=127.0.0.1 :shutdown {"outcome" => "success"}

                           

                          Allowed the shutdown to complete immediately and leave you in a state of being able to start the service again. Credentials it would seem are set at line 164 and might require quotes around them

                           

                          In addition to any of the suggestions above:

                          If you run the service installer

                          C:\wildfly-8.2.0.Final\bin\service>service.bat install /user WildflyServiceRunner /password **servicerunnerpassword** /controller 127.0.0.1:9990 you will need to create a management realm user to match that.

                          %JBOSS_HOME%\bin\add-user.bat

                          • user type a) Management Realm
                          • username WildflyServiceRunner
                          • password **servicerunnerpassword**
                          • Do the rest of the user create

                           

                          Without this mapping you will grind to a 1053 system error.  The %CREDENTIALS% is creating --user <user> --password <password> IF it has been defined.

                          IF you have defined it you MUST ALSO define it with %JBOSS_HOME%\bin\add-user.bat as management realm user.

                           

                          If find that this works for me

                          • 10. Re: WildFly 8 service does not stop on Windows 2012 R2 core
                            rknechtel

                            I'm running Wildfly 8.2.1-Final on Windows Server 2012 R2.

                            Java 1.8_45

                             

                            I could not get the service to stop in "services".

                            I got the following error:

                            Error 1053: The service did not respond to the start or control request in a timely fashion" error message when you stop or pause a managed Windows service

                             

                            When trying to stop from command line I got the error:
                            Using the X86-64bit version of prunsrv

                            ERROR: Failed to load service configuration

                             

                            It stayed showing in a "stopping" state.

                            I ran sc delete to get rid of the service on all 4 of my servers (dev/test/preproduction/production) (these are new servers I am setting up as we are migrating off of WebSphere) and had to bounce the servers.

                            I installed the service without credentials originally so it ran as "Local System".

                            I removed the "--connect %CREDENTIALS%" from service.bat as recommended. But when I re-installed the service - I still have the same problem.

                             

                            I just ran:

                            %JBOSS_HOME%\bin\service\service.bat install

                            I also tried:

                            %JBOSS_HOME%\bin\service\service.bat install /controller <IP>:10090

                            And:

                            %JBOSS_HOME%\bin\service\service.bat install /controller 127.0.0.1:10090

                             

                             

                            It looks like running Wildfly as a Windows Service doesn't work to well (at least on Windows Server 2012 R2).

                             

                            Does anyone have any other ides on this issue besides removing the "--connect %CREDENTIALS%" from service.bat?

                             

                            Thank you,

                            • 11. Re: WildFly 8 service does not stop on Windows 2012 R2 core
                              jim.lomas

                              It works fine as long as you understand batch script variable expansion (and I don't fully understand it btw...it's very different to bash on linux), nested if logic and the mapping of management users and how they are linked to the way your service is defined in the windows services list.

                               

                              The Local System is "Log On As" for the windows service authentication interface and does not necessarily map directly to a management realm user in your WildFly installation.

                               

                              There are 2 key chunks to this service installation:

                              %JBOSS_HOME%\bin\service\service.bat line 164

                              set CREDENTIALS=...

                              Says "If you have defined a JBOSSUSER value at line 97 and not defined a corresponding password at line 98, then I will spit you a message complaining as such and then I will end this batch script because you would be trying to do something I am not designed to handle."

                              If JBOSSUSER is blank then it will not worry about a password.

                               

                              So let's try a little bit of a spike:

                              Open a command line (or drop into cmd from powershell)

                              C:\>set CREDENTIALS=--user=%JBOSSUSER% --password=%PASSWORD%

                              C:\>echo %CREDENTIALS%

                              --user=%JBOSSUSER% --password=%PASSWORD%

                              C:\>set JBOSSUSER=USER1

                              C:\>echo %CREDENTIALS%

                              --user=%JBOSSUSER% --password=%PASSWORD%

                              So now reset the credentials

                              C:\>set CREDENTIALS=--user=%JBOSSUSER% --password=%PASSWORD%

                              C:\> echo %CREDENTIALS%

                              --user=USER1 --password=%PASSWORD%

                               

                              It is possible that this might be a glitch in service.bat, or the way windows expands variable values.

                               

                              OK the other 2nd chunk is at line 174 where we strip out the --connect %CREDENTIALS%

                               

                              We all know what jboss-cli.bat is used for right? (RIGHT??!! )

                               

                              Spike time:

                              cd %JBOSS_HOME%\bin

                              C:\JBH\bin>jboss-cli.bat

                              You are disconnected at the moment type 'connect' ......

                              help

                              --connect (-c) ...

                              shutdown

                              The command is not available.... connection to the controller might be unavailable

                               

                              OOPS... we forgot to connect to the server

                               

                              connect

                              [Nope...cuz the server ain't running]

                              quit

                               

                              OOPS... start server in another window with standalone.bat

                              Now try again

                               

                              C:\JBH\bin>jboss-cli.bat

                              You are disconnected.....

                              connect

                              [standalone@localhost:9990]

                              <YAY connected>

                              shutdown

                              [And the server shuts down in the other window]

                               

                              So let's see if we can string this together:

                              C:\JBH\bin>%JBOSS_HOME%\bin\jboss-cli.bat --controller=localhost:9990 --command=shutdown

                              The command is not available.... connection to the controller might be unavailable

                              OOPS... forgot to connect again

                              %JBOSS_HOME%\bin\jboss-cli.bat --controller=localhost:9990 --connect --command=shutdown

                              [And the server shuts down in the other window]

                               

                              So by all means rip the %CREDENTIALS% out, if you want

                              but leave the --connect in!!!

                               

                              The service shutdown is doing nothing more than calling jboss-cli.bat on your behalf, so make sure the syntax for that call is the correct one for your installation and network configuration.

                              • 12. Re: WildFly 8 service does not stop on Windows 2012 R2 core
                                rknechtel

                                Thank you for the tidbits. I got it working.

                                 

                                I changed line 178 from:

                                set STOPPARAM="/c \"set NOPAUSE=Y ^^^&^^^& jboss-cli.bat --controller=%CONTROLLER% --connect %CREDENTIALS% --command=:shutdown\""

                                To:

                                set STOPPARAM="/c jboss-cli.bat --connect --controller=%CONTROLLER% --command=:shutdown"

                                 

                                 

                                And it now stops/starts/restarts as a windows service just fine.

                                • 13. Re: WildFly 8 service does not stop on Windows 2012 R2 core
                                  jim.lomas

                                  Glad it helped.   Now if only those WildFly and Hibernate guys could determine how to log at the right level instead of spamming the monkeys out of standard out, that would make life a whole heap easier and get my boss off my back.

                                  • 14. Re: WildFly 8 service does not stop on Windows 2012 R2 core
                                    rknechtel

                                    Have you tried adding a logging category to the logging subsystem?  I do this in my applications to shut up HIbernate spewing out into my logs. Set level to ERROR or FATAL - something high. Anything where they use system.out - your screwed....

                                     

                                    <subsystem xmlns="urn:jboss:domain:logging:2.0">

                                    ........

                                     

                                    I just use something like:

                                    <logger category="org.hibernate">

                                      <level name="ERROR"/>

                                    </logger>

                                    1 2 Previous Next