Anaplan connect 1.4 Shell Script

Hi Leaders,

I have got encountered with the below error as I try to do Anaplan connect version upgrade 1.3 to 1.4. Not able to figure out the error.

Script: 

# This script executes a data load import to the model

set JAVA_HOME="/****/jdk1.8.0_191/bin/java"
set CertPath="/******/OpenSSL-Win64/bin/certificate.pem"
set PrivateKey="/******/OpenSSL-Win64/bin/private2.key"
set WorkspaceId="*********"
set ModelId="*********"
set ServiceUrl="https://api.anaplan.com"
set AuthUrl="https://auth.anaplan.com"
set Operation="'-debug -service %ServiceUrl% -auth %AuthUrl% -workspace %WorkspaceId% -model %ModelId% -file '*****.txt' -loadclass "oracle.jdbc.driver.OracleDriver" -jdbcproperties '********.properties' -import 'LIST IMPORT' -execute -output '*******/LogFiles.log'"

#________________ Do not edit below this line __________________

if [ "${PrivateKey}" ]; then
Credentials="-certificate ${CertPath} -privatekey ${PrivateKey}"
fi

echo cd "`dirname "$0"`"
cd "`dirname "$0"`"

if [ ! -f AnaplanClient.sh ]; then
echo "Please ensure this script is in the same directory as AnaplanClient.sh." >&2
exit 1
elif [ ! -x AnaplanClient.sh ]; then
echo "Please ensure you have executable permissions on AnaplanClient.sh." >&2
exit 1
fi
Command="./AnaplanClient.sh ${Credentials} ${Operation}"
/bin/echo "${Command}"
exec /bin/sh -c "${Command}"

 

Error :

[ anaplan-connect]$ ./runAPFactDataLoad_New.sh

cd .

./AnaplanClient.sh

Absolute path to JAVA8 or JAVA11 or OpenJDK8 executable not provided. Will attempt to figure out path from JAVA_HOME or which command...

Found Java executable from 'which' command: /opt/jdk/jdk1.8.0_191/bin/java

Java 8 found!

Java 8 found!

Using ./anaplan-connect-1.4.2-jar-with-dependencies.jar

2019-12-06 14:59:56 ERROR 38215 |--   Options are:

 

Answers

  • It looks like you have included some Windows batch file script content into a Unix shell script.

    In your Operation you need to replace each %Variable% usage with $Variable (or ${Variable}). Bear in mind that Unix shell variable names are case sensitive.

    You also need to remove the "set " from each variable assignment.

    For JAVA_HOME to take effect you might need to export it - the most portable way to do this is to "export JAVA_HOME" as a separate command after setting it. It doesn't look like you need it at the moment as AnaplanClient.sh is finding it automatically - presumably the bin directory is included in $PATH.

     

  • Hi Ben,

    Thanks and I've made recommended changes. I got encountered with another error saying "No suitable driver found", can you please suggest. 

  • Made few changes and had a success run.