Friday, August 9, 2013

-classpath is not recognized as an internal or external command operable program or batch file

During Connections 4.5 installation, at the point of launching cognos-setup.bat, I get this error :


Success to verify the JDBC connection to Cognos Content Store database.
'-classpath' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
Failed to verify the JDBC connection to Metrics database. Please check the error
 message.
Validation failed, unable to continue setup
Which in English is :
-classpath is not recognized as an internal or external command operable program or batch file
 May this be because of parenthesis in my password ?

-> No I changed every related password on this server and no amelioration.

What annoys me is that it's not even an error message ! That's a bug and that bug was already on version 4. I opened a PMR then but finally abandonned.

Finally solved by modifying the cognos-setup.bat!

  1. JDBC Connection for Cognos Content Manager works but not JDBC Connection for Metrics.
  2. I bypass the verifying of the JDBC Connection for Cognos Content Manager and now JDBC Connection for Metrics works ok!
That means that everything is good in my file but the ".bat" is not constructed correctly ??
I have some difficulty believing that this batch was not tested... So what is the difference between my environment and everyone else's ?

Here is the modification of cognos-setup.bat (basically I just added a bunch of "REM") :


REM Validate the JDBC connection.
SET was=%was.install.path%
SET java="%was%\java\bin\java.exe"
SET JAR_HOME=%cognosSetupScriptPath_%BI-Customization\JDBC\*
PUSHD %cognosSetupScriptPath_%lib
SET cp=.;"%CD%\*";"%JAR_HOME%"
POPD
REM Validate the JDBC connection to Cognos Content Store database
REM SETLOCAL ENABLEDELAYEDEXPANSION
REM    set "java_PATH=!java!"
REM FOR /F "tokens=*" %%j IN ('"!java_PATH! -classpath %cp% com.ibm.connections.metrics.cognos.install.CognosDBJDBCConnectionVerifer %cognos.db.type% %cognos.db.host% %cognos.db.name% %cognos.db.user% %cognos.db.password%"') DO (
REM ENDLOCAL
REM IF "%%j" == "JDBC Connection Success" SET cognosjdbcconnection=true
REM CALL :log %%j
REM )
REM IF NOT "%cognosjdbcconnection%" == "true" (
REM CALL :log Failed to verify the JDBC connection to Cognos Content Store database. Please check the error message.
REM EXIT /b 1
REM )
REM CALL :log Success to verify the JDBC connection to Cognos Content Store database.
REM Validate the JDBC connection to Metrics database
SETLOCAL ENABLEDELAYEDEXPANSION
    set "java_PATH=!java!"
FOR /F "tokens=*" %%j IN ('"!java_PATH! -classpath %cp% com.ibm.connections.metrics.cognos.install.MetricsDBJDBCConnectionVerifer %metrics.db.type% %metrics.db.host% %metrics.db.name% %metrics.db.user% %metrics.db.password%"') DO (
ECHO %%j
ENDLOCAL
IF "%%j" == "JDBC Connection Success" SET metricsjdbcconnection=true
CALL :log %%j
)
IF NOT "%metricsjdbcconnection%" == "true" (
CALL :log Failed to verify the JDBC connection to Metrics database. Please check the error message.
EXIT /b 1
)
CALL :log Success to verify the JDBC connection to Metrics database.
CALL :log ... performing validation check completed
ENDLOCAL
GOTO :EOF

During cognos-configure.bat, same problem of course. This time I took a different approached. I duplicated a paragraph which is used to set parameters. This one :

REM Validate the JDBC connection.
SET was=%was.install.path%
SET java="%was%\java\bin\java.exe"
SET JAR_HOME=%cognosSetupScriptPath_%BI-Customization\JDBC\*
PUSHD %cognosSetupScriptPath_%lib
SET cp=.;"%CD%\*";"%JAR_HOME%"
POPD

Here is the final result for cognos-configure.bat :

REM Validate the JDBC connection.
SET was=%was.install.path%
SET java="%was%\java\bin\java.exe"
SET JAR_HOME=%cognosSetupScriptPath_%BI-Customization\JDBC\*
PUSHD %cognosSetupScriptPath_%lib
SET cp=.;"%CD%\*";"%JAR_HOME%"
POPD
REM Validate the JDBC connection to Cognos Content Store database
SETLOCAL ENABLEDELAYEDEXPANSION
    set "java_PATH=!java!"
FOR /F "tokens=*" %%j IN ('"!java_PATH! -classpath %cp% com.ibm.connections.metrics.cognos.install.CognosDBJDBCConnectionVerifer %cognos.db.type% %cognos.db.host% %cognos.db.name% %cognos.db.user% %cognos.db.password%"') DO (
ENDLOCAL
IF "%%j" == "JDBC Connection Success" SET cognosjdbcconnection=true
CALL :log %%j
)
IF NOT "%cognosjdbcconnection%" == "true" (
CALL :log Failed to verify the JDBC connection to Cognos Content Store database. Please check the error message.
EXIT /b 1
)
CALL :log Success to verify the JDBC connection to Cognos Content Store database.
REM Validate the JDBC connection.
SET was=%was.install.path%
SET java="%was%\java\bin\java.exe"
SET JAR_HOME=%cognosSetupScriptPath_%BI-Customization\JDBC\*
PUSHD %cognosSetupScriptPath_%lib
SET cp=.;"%CD%\*";"%JAR_HOME%"
POPD
REM Validate the JDBC connection to Metrics database
SETLOCAL ENABLEDELAYEDEXPANSION
    set "java_PATH=!java!"
FOR /F "tokens=*" %%j IN ('"!java_PATH! -classpath %cp% com.ibm.connections.metrics.cognos.install.MetricsDBJDBCConnectionVerifer %metrics.db.type% %metrics.db.host% %metrics.db.name% %metrics.db.user% %metrics.db.password%"') DO (
ENDLOCAL
IF "%%j" == "JDBC Connection Success" SET metricsjdbcconnection=true
CALL :log %%j
)
IF NOT "%metricsjdbcconnection%" == "true" (
CALL :log Failed to verify the JDBC connection to Metrics database. Please check the error message.
EXIT /b 1
)
CALL :log Success to verify the JDBC connection to Metrics database.
CALL :log ... performing validation check completed
ENDLOCAL
GOTO :EOF

This worked also, but I don't like having to modify the batch. I could have opened a PMR but that would take me 3 weeks again and a lot of work


No comments:

Post a Comment