7 Replies Latest reply on Jun 26, 2013 10:20 AM by JS Bournival

    Help! CQ 5.6 as a Windows Service LDAP config

    JS Bournival Level 1

      Hi have this strange problem:

       

      If I start CQ on the command line using the usual stuff (I'm on Java 1.7)

       

      "C:\Windows\System32\java.exe" -Xmx1024m -XX:MaxPermSize=256M -Djava.security.auth.login.config=crx-quickstart\conf\ldap_login.conf -jar cq-author-p4502.jar -use-control-port -p 4502 -nobrowser -nofork

       

      It's picking up my LDAP configuration correctly.  But if I'm using the windows service, I was never able to make it pick up my configuration. 

       

      LOG: 

       

      26.06.2013 10:29:58.328 *ERROR* [FelixStartLevel] org.apache.jackrabbit.core.DefaultSecurityManager Neither JAAS nor RepositoryConfig contained a valid configuration for com.day.crx

      26.06.2013 10:29:58.328 *ERROR* [FelixStartLevel] org.apache.jackrabbit.core.RepositoryImpl failed to start Repository: Neither JAAS nor RepositoryConfig contained a valid configuration for com.day.crx javax.jcr.RepositoryException: Neither JAAS nor RepositoryConfig contained a valid configuration for com.day.crx

       

      Very frustrating.  Can somebody help me figure this out please? It's important.

       

      Here is my start-service.bat file configuration section:

       

      ::@echo off

      setlocal

       

      :: This script configures the windows service start information for this server.

      ::

      :: The following variables may be used to override the defaults.

       

      ::* TCP port used for stop and status scripts

      set CQ_PORT=4502

       

      ::* interface that this server should listen to (ip or hostname)

      :: set CQ_HOST=

       

      ::* show gui

      :: set CQ_GUI=true

       

      ::* do not show browser on startup

      set CQ_NOBROWSER=true

       

      ::* do not redirect stdout/stderr (logs to console)

      :: set CQ_VERBOSE=true

      :: set CQ_VERBOSE=true

       

      ::* do not fork the JVM

      set CQ_NOFORK=true

       

      ::* force forking the VM using recommended default memory settings

      :: set CQ_FORK=true

       

      ::* additional arguments for the forked JVM

      :: set CQ_FORKARGS=

       

      ::* runmode(s)

      :: set CQ_RUNMODE=

       

      ::* defines the path under which the quickstart work folder is located

      :: set CQ_BASEFOLDER=

       

      ::* low memory action

      :: set CQ_LOWMEMACTION=

       

      ::* name of the jarfile

      :: set CQ_JARFILE=

       

      ::* use jaas.config

      set CQ_USE_JAAS=true

       

      ::* config for jaas

      set CQ_JAAS_CONFIG=crx-quickstart/conf/ldap_login.conf

       

      ::* default JVM options

      set CQ_JVM_OPTS=-Xmx1024m -XX:MaxPermSize=256M

       

      ::* Uncomment, or redefine one of the follwoing JAVA_HOME if you wish a

      ::  different than your default one

      ::

      ::  set JAVA_HOME=c:\java\jdk1.4.2_08

        • 1. Re: Help! CQ 5.6 as a Windows Service LDAP config
          dcollie Adobe Employee

          Use the full path to your ldap_login.conf in your script and try again (alter crx-quickstart/opt/helpers/start-service.bat for when running as service)

           

          If still broke, what's the output of the command to start if you run the service-start.bat on the command line.   Check and make sure the -D arguments occur all before the cq-author-p4502.jar file.   In older start scripts the command ends up being something similar to:

           

          "C:\Windows\System32\java.exe" -Xmx1024m -XX:MaxPermSize=256M -jar cq-author-p4502.jar -use-control-port -p 4502 -nobrowser -nofork -Djava.security.auth.login.config=crx-quickstart\conf\ldap_login.conf

           

          Rather than:

           

          "C:\Windows\System32\java.exe" -Xmx1024m -XX:MaxPermSize=256M -Djava.security.auth.login.config=crx-quickstart\conf\ldap_login.conf -jar cq-author-p4502.jar -use-control-port -p 4502 -nobrowser -nofork

          • 2. Re: Help! CQ 5.6 as a Windows Service LDAP config
            JS Bournival Level 1

            Thanks for the reply,

             

            I modified the start-service.bat to use the full path, but same result:

             

            ::* config for jaas

            set CQ_JAAS_CONFIG=D:\author\crx-quickstart\conf\ldap_login.conf

             

            As for running the script directly, it fails because it says it cannot find the jar (?).  However, here is the ouput (command line seems OK) :

             

            D:\author>crx-quickstart\opt\helpers\start-service.bat

             

             

            D:\author>setlocal

             

             

            D:\author>set CQ_PORT=4502

             

             

            D:\author>set CQ_NOBROWSER=true

             

             

            D:\author>set CQ_NOFORK=true

             

             

            D:\author>set CQ_USE_JAAS=true

             

             

            D:\author>set CQ_JAAS_CONFIG=D:\author\crx-quickstart\conf\ldap_login.conf

             

             

            D:\author>set CQ_JVM_OPTS=-Xmx1024m -XX:MaxPermSize=256M

             

             

            D:\author>cd ..

             

             

            D:\>set START_OPTS=-use-control-port

             

             

            D:\>if defined CQ_PORT set START_OPTS=-use-control-port -p 4502

             

             

            D:\>if defined CQ_GUI set START_OPTS=-use-control-port -p 4502 -gui

             

             

            D:\>if defined CQ_NOBROWSER set START_OPTS=-use-control-port -p 4502 -nobrowser

             

             

            D:\>if defined CQ_VERBOSE set START_OPTS=-use-control-port -p 4502 -nobrowser -verbose

             

             

            D:\>if defined CQ_NOFORK set START_OPTS=-use-control-port -p 4502 -nobrowser -nofork

             

             

            D:\>if defined CQ_FORK set START_OPTS=-use-control-port -p 4502 -nobrowser -nofork -fork

             

             

            D:\>if defined CQ_FORKARGS set START_OPTS=-use-control-port -p 4502 -nobrowser -nofork -forkargs

             

             

            D:\>if defined CQ_RUNMODE set START_OPTS=-use-control-port -p 4502 -nobrowser -nofork -r

             

             

            D:\>if defined CQ_BASEFOLDER set START_OPTS=-use-control-port -p 4502 -nobrowser -nofork -b

             

             

            D:\>if defined CQ_LOWMEMACTION set START_OPTS=-use-control-port -p 4502 -nobrowser -nofork -low-mem-action

             

             

            D:\>if defined CQ_HOST set CQ_JVM_OPTS=-Xmx1024m -XX:MaxPermSize=256M -Dorg.apache.felix.http.host=

             

             

            D:\>if defined CQ_HOST set START_OPTS=-use-control-port -p 4502 -nobrowser -nofork -a

             

             

            D:\>if defined CQ_USE_JAAS set CQ_JVM_OPTS=-Xmx1024m -XX:MaxPermSize=256M -Djava.security.auth.login.config=D:\author\crx-quickstart\conf\ldap_login.conf

             

             

            D:\>if not defined CQ_JARFILE for %X in (*.jar) do set CQ_JARFILE=%X

             

             

            D:\>if not defined JAVA_HOME (call :which java.exe JAVA )  else (set JAVA="\bin\java.exe" )

             

             

            D:\>setlocal

             

             

            D:\>set res="C:\Windows\System32\java.exe"

             

             

            D:\>endlocal & set JAVA="C:\Windows\System32\java.exe"  & goto :EOF

             

             

            D:\>if "C:\Windows\System32\java.exe" == "" (

            echo JAVA_HOME not specified and no java.exe in PATH

            goto exit

            )

             

             

            D:\>if not exist "C:\Windows\System32\java.exe" (

            echo No JVM found at "C:\Windows\System32\java.exe"

            goto exit

            )

             

             

            D:\>"C:\Windows\System32\java.exe" -Xmx1024m -XX:MaxPermSize=256M -Djava.security.auth.login.config=D:\author\crx-quickstart\conf\ldap_login.conf -jar cq-author-p4502.jar -use-control-port -p 4502 -nobrowser -nofork

            Error: Unable to access jarfile cq-author-p4502.jar

             

             

            D:\>echo -------------------------------------------------------------------------------

            -------------------------------------------------------------------------------

             

             

            D:\>echo Starting...

            Starting...

             

             

            D:\>echo -------------------------------------------------------------------------------

            -------------------------------------------------------------------------------

             

             

            D:\>call "C:\Windows\System32\java.exe"  -version

            java version "1.7.0_25"

            Java(TM) SE Runtime Environment (build 1.7.0_25-b17)

            Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

             

             

            D:\>echo -------------------------------------------------------------------------------

            -------------------------------------------------------------------------------

             

             

            D:\>echo "C:\Windows\System32\java.exe"   -jar

            "C:\Windows\System32\java.exe"   -jar

             

             

            D:\>echo -------------------------------------------------------------------------------

            -------------------------------------------------------------------------------

             

             

            D:\>"C:\Windows\System32\java.exe"   -jar ""

            Error: Unable to access jarfile

             

             

            D:\>goto exit

             

             

            D:\>endlocal

            • 3. Re: Help! CQ 5.6 as a Windows Service LDAP config
              JS Bournival Level 1

              ... and what's funnier is that if I just copy paste and run that line:

               

              "C:\Windows\System32\java.exe" -Xmx1024m -XX:MaxPermSize=256M -Djava.security.auth.login.config=D:\author\crx-quickstart\conf\ldap_ login.conf -jar cq-author-p4502.jar -use-control-port -p 4502 -nobrowser -nofork

               

              It works like a charm! :-s

               

              I'm puzzled.

              • 4. Re: Help! CQ 5.6 as a Windows Service LDAP config
                dcollie Adobe Employee

                >> As for running the script directly, it fails because it says it cannot find the jar (?).

                 

                You would need to make sure you launched the service-start.bat from the "crx-quickstart\opt\helpers" directory, as it's doing tree traversal to find the CQ jar file. (got that wrong )

                You need to start from "crx-quickstart" folder, e.g.: D:\Tools\CQ\5.6-GM\crx-quickstart>opt\helpers\start-service.bat

                 

                Try setting full path using the variable in the script?

                ::* name of the jarfile

                :: set CQ_JARFILE=


                 


                • 5. Re: Help! CQ 5.6 as a Windows Service LDAP config
                  JS Bournival Level 1

                  yup, working.  but still no luck from the windows service.  Does it even use this script (start-service)?? I put garbage in it and still it starts.

                  • 6. Re: Help! CQ 5.6 as a Windows Service LDAP config
                    dcollie Adobe Employee

                    Have a look at the instsrv.bat, it did in earlier versions, will test 5.6 tomorrow.

                    Or try this http://cqquest.blogspot.ie/2012/05/ldap-fail-in-cq55.html

                    • 7. Re: Help! CQ 5.6 as a Windows Service LDAP config
                      JS Bournival Level 1

                      working.  Documentation should make clear how to cope with this.

                       

                      thanx for your help.