9 Replies Latest reply on Jul 29, 2013 9:02 AM by nickarls

    jboss-as-7.1.1.Final- 'findstr' is not recognized as an internal or external command operable program or batch file

    asif07

      I get the Error; as follows when I try to start the Jboss server.

       

      C:\jboss-as-7.1.1.Final\bin> standalone.bat

      Calling "C:\jboss-as-7.1.1.Final\bin\standalone.conf.bat"

      'findstr' is not recognized as an internal or external command,

      operable program or batch file.

       

       

      I did gogled and tried the following Solutions but to no avail; 

       

      1. Commented "Findstr" in the following lines.. in the file standalone.cof

       

       

      echo "%JAVA_OPTS%" | findstr /I \-server > nul

        if errorlevel == 1 (

          "%JAVA%" -client -version 2>&1 | findstr /I /C:"Client VM" > nul

      --

      echo "%JAVA_OPTS%" | findstr /I "\-XX:\-UseCompressedOops \-client" > nul

       

       

      --

      echo "%JAVA_OPTS%" | findstr /I "\-XX:\-TieredCompilation \-client" > nul

       

       

      2. Installed JDK6 U 34( earlier I was running on jre

       

      3. Copied findstr.exe to jbossx.x.x/bin directory & then to the JAVA_HOMe/bin  directory

       

       

      4. Added "C:\Windows\System32" to the "Path" of "system variables"

       

       

      All the Above did not Yield Any result.

       

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

      OS: Windows 2008

      Jboss version :jboss-as-7.1.1.Final

       

      C:\jboss-as-7.1.1.Final\bin>echo %JAVA_HOME%

      C:\Program Files\Java\jdk1.6.0_34

       

      C:\jboss-as-7.1.1.Final\bin>path

      PATH=%JAVA_HOME%\bin;C:\WINDOWS\system32

       

       

      C:\jboss-as-7.1.1.Final\bin>set

      ALLUSERSPROFILE=C:\ProgramData

      APPDATA=C:\Users\Administrator\AppData\Roaming

      CLIENTNAME=SNG-INF-VWJH01

      CommonProgramFiles=C:\Program Files\Common Files

      CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files

      CommonProgramW6432=C:\Program Files\Common Files

      COMPUTERNAME=CIAC31

      ComSpec=C:\Windows\system32\cmd.exe

      DEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection

      FP_NO_HOST_CHECK=NO

      HOMEDRIVE=C:

      HOMEPATH=\Users\Administrator

      JAVA_HOME=C:\Program Files\Java\jdk1.6.0_34

      LOCALAPPDATA=C:\Users\Administrator\AppData\Local

      LOGONSERVER=\\CIAC31

      NUMBER_OF_PROCESSORS=4

      OS=Windows_NT

      Path=%JAVA_HOME%\bin;C:\WINDOWS\system32

      PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

      PROCESSOR_ARCHITECTURE=AMD64

      PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 44 Stepping 2, GenuineIntel

      PROCESSOR_LEVEL=6

      PROCESSOR_REVISION=2c02

      ProgramData=C:\ProgramData

      ProgramFiles=C:\Program Files

      ProgramFiles(x86)=C:\Program Files (x86)

      ProgramW6432=C:\Program Files

      PROMPT=$P$G

      PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\

      PUBLIC=C:\Users\Public

      SESSIONNAME=RDP-Tcp#0

      SystemDrive=C:

      SystemRoot=C:\Windows

      TEMP=C:\Users\ADMINI~1\AppData\Local\Temp\2

      TMP=C:\Users\ADMINI~1\AppData\Local\Temp\2

      USERDOMAIN=CIAC31

      USERNAME=Administrator

      USERPROFILE=C:\Users\Administrator

      VSEDEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection

      windir=C:\Windows

      windows_tracing_flags=3

      windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log

       

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

       

      5. I copied findstr in to the jboss-as-7.1.1.Final/bin directory I get the error as follows ;

      C:\jboss-as-7.1.1.Final\bin>standalone.bat

      Calling "C:\jboss-as-7.1.1.Final\bin\standalone.conf.bat"

       

      ( No error).. But the Jboss Doesnt start.

       

       

       

      However I could run the other batch files successfully  .like adduser.bat file with the same setting ( Path/Java_Home)

       

      Can Some one throw more light on thsi.

        • 1. Re: jboss-as-7.1.1.Final- 'findstr' is not recognized as an internal or external command operable program or batch file
          nickarls

          Strange, I thought findstr.exe was available on 2008. Did you try putting it in windows\system32?

          • 2. Re: jboss-as-7.1.1.Final- 'findstr' is not recognized as an internal or external command operable program or batch file
            asif07

            I copied findstr.exe from windows\system32  TO the other directories

            • 3. Re: jboss-as-7.1.1.Final- 'findstr' is not recognized as an internal or external command operable program or batch file
              nickarls

              Ah, OK, I misunderstood.

               

              So from a shell you can do "findstr" and the binary is found but not from standalone.bat?

              Can you edit standalone.bat and echo the PATH env variable just before findstr is used?

              • 4. Re: jboss-as-7.1.1.Final- 'findstr' is not recognized as an internal or external command operable program or batch file
                asif07

                Thanks Nick.

                The  "findstr" work  from the shell..

                I could not figure outfrom the Echo.

                Posting the Standalone.bat here ( And also as atachment)

                ================================================

                @echo off

                rem -------------------------------------------------------------------------

                rem JBoss Bootstrap Script for Windows

                rem -------------------------------------------------------------------------

                 

                 

                rem $Id$

                 

                 

                @if not "%ECHO%" == ""  echo %ECHO%

                @if "%OS%" == "Windows_NT" setlocal

                 

                 

                if "%OS%" == "Windows_NT" (

                  set "DIRNAME=%~dp0%"

                ) else (

                  set DIRNAME=.\

                )

                 

                 

                rem Read an optional configuration file.

                if "x%STANDALONE_CONF%" == "x" (

                   set "STANDALONE_CONF=%DIRNAME%standalone.conf.bat"

                )

                if exist "%STANDALONE_CONF%" (

                   echo Calling "%STANDALONE_CONF%"

                   call "%STANDALONE_CONF%" %*

                ) else (

                   echo Config file not found "%STANDALONE_CONF%"

                )

                 

                 

                pushd %DIRNAME%..

                set "RESOLVED_JBOSS_HOME=%CD%"

                popd

                 

                 

                if "x%JBOSS_HOME%" == "x" (

                  set "JBOSS_HOME=%RESOLVED_JBOSS_HOME%"

                )

                 

                 

                pushd "%JBOSS_HOME%"

                echo "%JBOSS_HOME%"

                set "SANITIZED_JBOSS_HOME=%CD%"

                popd

                 

                 

                if "%RESOLVED_JBOSS_HOME%" NEQ "%SANITIZED_JBOSS_HOME%" (

                    echo WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.

                )

                 

                 

                set DIRNAME=

                 

                 

                if "%OS%" == "Windows_NT" (

                  set "PROGNAME=%~nx0%"

                ) else (

                  set "PROGNAME=standalone.bat"

                )

                 

                 

                rem Setup JBoss specific properties

                set JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%

                 

                 

                if "x%JAVA_HOME%" == "x" (

                  set  JAVA=java

                  echo JAVA_HOME is not set. Unexpected results may occur.

                  echo Set JAVA_HOME to the directory of your local JDK to avoid this message.

                ) else (

                  set "JAVA=%JAVA_HOME%\bin\java"

                )

                 

                 

                if not "%PRESERVE_JAVA_OPTS%" == "true" (

                  rem Add -client to the JVM options, if supported (32 bit VM), and not overriden

                   echo "%JAVA_OPTS%" | findstr /I \-server > nul

                  if errorlevel == 1 (

                    "%JAVA%" -client -version 2>&1 | findstr /I /C:"Client VM" > nul

                    if not errorlevel == 1 (

                      set "JAVA_OPTS=-client %JAVA_OPTS%"

                    )

                  )

                 

                 

                  rem Add compressed oops, if supported (64 bit VM), and not overriden

                   echo "%JAVA_OPTS%" | findstr /I "\-XX:\-UseCompressedOops \-client" > nul

                  if errorlevel == 1 (

                    "%JAVA%" -XX:+UseCompressedOops -version > nul 2>&1

                    if not errorlevel == 1 (

                      set "JAVA_OPTS=-XX:+UseCompressedOops %JAVA_OPTS%"

                    )

                  )

                 

                 

                  rem Add tiered compilation, if supported (64 bit VM), and not overriden

                  echo "%JAVA_OPTS%" | findstr /I "\-XX:\-TieredCompilation \-client" > nul

                  if errorlevel == 1 (

                    "%JAVA%" -XX:+TieredCompilation -version > nul 2>&1

                    if not errorlevel == 1 (

                      set "JAVA_OPTS=-XX:+TieredCompilation %JAVA_OPTS%"

                    )

                  )

                )

                 

                 

                rem Find jboss-modules.jar, or we can't continue

                if exist "%JBOSS_HOME%\jboss-modules.jar" (

                    set "RUNJAR=%JBOSS_HOME%\jboss-modules.jar"

                ) else (

                  echo Could not locate "%JBOSS_HOME%\jboss-modules.jar".

                  echo Please check that you are in the bin directory when running this script.

                  goto END

                )

                 

                 

                rem Setup JBoss specific properties

                 

                 

                rem Setup the java endorsed dirs

                set JBOSS_ENDORSED_DIRS=%JBOSS_HOME%\lib\endorsed

                 

                 

                rem Set default module root paths

                if "x%JBOSS_MODULEPATH%" == "x" (

                  set  "JBOSS_MODULEPATH=%JBOSS_HOME%\modules"

                )

                 

                 

                rem Set the standalone base dir

                if "x%JBOSS_BASE_DIR%" == "x" (

                  set  "JBOSS_BASE_DIR=%JBOSS_HOME%\standalone"

                )

                rem Set the standalone log dir

                if "x%JBOSS_LOG_DIR%" == "x" (

                  set  "JBOSS_LOG_DIR=%JBOSS_BASE_DIR%\log"

                )

                rem Set the standalone configuration dir

                if "x%JBOSS_CONFIG_DIR%" == "x" (

                  set  "JBOSS_CONFIG_DIR=%JBOSS_BASE_DIR%/configuration"

                )

                 

                 

                echo ===============================================================================

                echo.

                echo   JBoss Bootstrap Environment

                echo.

                echo   JBOSS_HOME: %JBOSS_HOME%

                echo.

                echo   JAVA: %JAVA%

                echo.

                echo   JAVA_OPTS: %JAVA_OPTS%

                echo.

                echo ===============================================================================

                echo.

                 

                 

                :RESTART

                "%JAVA%" %JAVA_OPTS% ^

                "-Dorg.jboss.boot.log.file=%JBOSS_LOG_DIR%\boot.log" ^

                "-Dlogging.configuration=file:%JBOSS_CONFIG_DIR%/logging.properties" ^

                    -jar "%JBOSS_HOME%\jboss-modules.jar" ^

                    -mp "%JBOSS_MODULEPATH%" ^

                    -jaxpmodule "javax.xml.jaxp-provider" ^

                     org.jboss.as.standalone ^

                    -Djboss.home.dir="%JBOSS_HOME%" ^

                     %*

                 

                 

                if ERRORLEVEL 10 goto RESTART

                 

                 

                :END

                if "x%NOPAUSE%" == "x" pause

                 

                 

                :END_NO_PAUSE

                ========================================================

                • 5. Re: jboss-as-7.1.1.Final- 'findstr' is not recognized as an internal or external command operable program or batch file
                  nickarls

                  Just put an echo %PATH% before the calls to findstr and report the output.

                  Since you apparently put the windows/system32 on the PATH, I'd like to see that it's still there when the findstr is required

                  • 6. Re: jboss-as-7.1.1.Final- 'findstr' is not recognized as an internal or external command operable program or batch file
                    asif07

                    It does...

                     

                    C:\jboss-as-7.1.1.Final\bin>standalone.bat

                    Calling "C:\jboss-as-7.1.1.Final\bin\standalone.conf.bat"

                    %JAVA_HOME%\bin;C:\WINDOWS\system32

                    • 7. Re: jboss-as-7.1.1.Final- 'findstr' is not recognized as an internal or external command operable program or batch file
                      nickarls

                      Strange, I though the path would be fully expanded. What happens if you put the windows/system32 into the PATH in the windows "advanced system settings" and not in the script?

                      • 8. Re: jboss-as-7.1.1.Final- 'findstr' is not recognized as an internal or external command operable program or batch file
                        asif07

                        With   the PATH in the windows "advanced system settings"

                        I get the following ;

                        C:\jboss-as-7.1.1.Final\bin>standalone.bat

                        Calling "C:\jboss-as-7.1.1.Final\bin\standalone.conf.bat"

                         

                        With & With Out  PATH in the windows "advanced system settings" But with PATH in the Script.

                        C:\jboss-as-7.1.1.Final\bin>standalone.bat

                        Calling "C:\jboss-as-7.1.1.Final\bin\standalone.conf.bat"

                        %JAVA_HOME%\bin;C:\WINDOWS\system32

                         

                         


                         


                        • 9. Re: jboss-as-7.1.1.Final- 'findstr' is not recognized as an internal or external command operable program or batch file
                          nickarls

                          So "path", "set" and "echo %PATH%" in the cmd window show the windows/system32 included but the echo %PATH% shows blank? If so, what is resetting it?