7 Replies Latest reply on Jul 16, 2013 12:22 AM by MarcGriebenow

    Windows Service failing to start

    garth914 Level 1

      Hello Everyone,

       

      I'm trying to run CQ 5.6.1 as a service on Windows Server 2008 R2 SP1 64-bit.

       

      I've replaced prunsrv in instsrv.bat with prunsrv_amd64.

       

      Installing the service seems fine, as does uninstalling.

       

      This is the kind of entry I see in my c:\CQ\5.6.1\publish\crx-quickstart\logs\commons-daemon.2013-07-11.log file after I try start the service:

       

      [2013-07-11 15:45:10] [info]  Commons Daemon procrun (1.0.8.0 64-bit) started

      [2013-07-11 15:45:10] [info]  Running 'cq5' Service...

      [2013-07-11 15:45:10] [info]  Starting service...

      [2013-07-11 15:45:10] [error] Failed creating java

      [2013-07-11 15:45:10] [error] Cannot create a file when that file already exists.

      [2013-07-11 15:45:10] [error] ServiceStart returned 1

      [2013-07-11 15:45:10] [error] Cannot create a file when that file already exists.

      [2013-07-11 15:45:10] [info]  Run service finished.

      [2013-07-11 15:45:10] [info]  Commons Daemon procrun finished

       

      The corresponding entry in the Event Log shows the following:

       

      <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

        <System>

          <Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" />

          <EventID Qualifiers="49152">7024</EventID>

          <Version>0</Version>

          <Level>2</Level>

          <Task>0</Task>

          <Opcode>0</Opcode>

          <Keywords>0x8080000000000000</Keywords>

          <TimeCreated SystemTime="2013-07-11T19:45:10.423634500Z" />

          <EventRecordID>7164</EventRecordID>

          <Correlation />

          <Execution ProcessID="516" ThreadID="1356" />

          <Channel>System</Channel>

          <Computer>cqpub-02</Computer>

          <Security />

        </System>

        <EventData>

          <Data Name="param1">cq5</Data>

          <Data Name="param2">%%0</Data>

        </EventData>

      </Event>

       

      This same behavior is exhibited across three separate servers each with their own installation of CQ (one as an author and two as publish).

       

      Any ideas what could be going wrong or where I can find more detailed information about where and what is trying to create a "java" file?  Is the start-service.bat used at all?

       

      Thanks!

      Garth

        • 1. Re: Windows Service failing to start
          MarcGriebenow Level 1

          Hi,

           

          is your JAVA_HOME properly set?

          echo %JAVA_HOME%

           

           

          Something went wrong at installing the service... How did you install it?

          Best way for me was to fill in the vars in instsrv.bat and run it without a parameter to install the service

           

          PS:

          Theres a little bug in instsrv.bat as the option

          set jvm_mx=16384m

          isnt properly handled by the script. You have to add the param to the jvm_options underneath

          • 2. Re: Windows Service failing to start
            garth914 Level 1

            Hi Marc,

             

            Thanks for your reply!

             

            JAVA_HOME is set.  It echoes out c:\Program Files\jdk1.7.0_25\jre.

             

            I installed the service as described by the documentation for the process.

             

            I've also applied the jvm_mx correction to jvm_options (as outlined by the documentation link above).

             

            No errors are reported during the installation, but evidently it's being installed misconfigured.  Adjusting instsrv.bat to only echo out the commands it runs gives back the following:

             

            C:\CQ\5.6.1\publish\crx-quickstart\opt\helpers>instsrv.bat cq5

             

            Installing service cq5

                runs in   C:\CQ\5.6.1\publish\crx-quickstart

                uses      C:\CQ\5.6.1\publish\crx-quickstart\opt\helpers\\..\..\app\cq-quickstart-5.6.1-standalone. jar

                starts    org.apache.sling.launchpad.app.Main

                redirects output to: C:\CQ\5.6.1\publish\crx-quickstart\logs\startup.log

             

            chdir /D C:\CQ\5.6.1\publish\crx-quickstart\opt\helpers\

            prunsrv_amd64 //IS//cq5 --Description="Adobe CQ5" --DisplayName="cq5" --Startup=

            ""auto"" --StartPath=C:\CQ\5.6.1\publish\crx-quickstart --Classpath=C:\CQ\5.6.1\publish\crx-quickstart\opt\helpers\\..\..\app\cq-quickstart-5.6.1 -standalone.jar --JvmMx=1792m --JvmOptions=-XX:MaxPermSize=256M;-Xmx1792m#-Dsling.run.modes="publish" --StdOutput=C:\CQ\5.6.1\publish\crx-quickstart\logs\startup.log --StdError=C:\CQ\5.6.1\publish\crx-quickstart\logs\startup.log --LogPath=C:\CQ\5.6.1\publish\crx-quickstart\logs --PidFile=..\conf\cq.pid --StartMode jvm --StartClass=org.apache.sling.launchpad.app.Main --StartParams=start#-c#.#-i#launchpad#-p#4503#

            -j#63000 --StopMode=jvm --StopClass=org.apache.sling.launchpad.app.Main --StopParams=stop --Jvm="auto"

             

            Do you think anything still looks wrong in there?

             

            Garth

            • 3. Re: Windows Service failing to start
              MarcGriebenow Level 1

              Don't see big failures there

               

              The --Startup= ""auto""  is double double quoted, but thats the same in my skript

               

              At the JvmOptions we have used the semicolon in double quotes, like this

              --JvmOptions=-XX:MaxPermSize=256M";"-Xmx1792m

              and there's a # after your JvmOptions I think shouldn't be there. In my script the -Dsling.run.modes... is appended to startparams  (CQ5.5)

               

              Biggest problem here was the parameter at instsrv.bat cmd call. Please try it without the "cq5", just instsrv.bat

              It should get the service name from parameters inside the script

               

               

              Everything refers to cq5.5 instsrv.bat, don't know if it was edited

               

              Greetz

              • 4. Re: Windows Service failing to start
                garth914 Level 1

                Thanks for your help, but sadly there's still no difference.  Everything appears to be set as necessary and running the script with or without the service name still results in failure when I try to start the service.

                 

                Unless any additional suggestions are forthcoming, it looks like I may need to submit a ticket to Adobe.

                 

                Garth

                • 5. Re: Windows Service failing to start
                  MarcGriebenow Level 1

                  Additionally to Adobe Ticket, you can look into registry at

                   

                  HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\{YOUR SERVICE NAME}\Parameters

                  if everything is set properly

                  There should be the folders Java, Log, Start and Stop

                   

                  If you like you can post the reg keys here

                   

                  Marc

                  • 6. Re: Windows Service failing to start
                    garth914 Level 1

                    Hrm... there's nothing in the Apache Software Foundation node at all!  Was there a setup step I missed somewhere that required these be registered before hand?  I'm guessing that this is part of what prunsrv_amd64 is supposed to do?

                    Capture.JPG

                    • 7. Re: Windows Service failing to start
                      MarcGriebenow Level 1

                      In service property dialog of your CQ5 service there has to be a label "Path to executable" with the prunsrv.exe like the following

                      YOUR_PATH_TO\crx-quickstart\opt\helpers\prunsrv_amd64.exe //RS//CQ5-Author

                       

                       

                      The string after //RS// you can search via regedit

                       

                      Maybe its in a different location

                       

                       

                      Did you try to reinstall your cq5 instance?