Technote

(troubleshooting)
Database migration results in NoClassDefFoundError exception on WSLauncher
Problem(Abstract)
You use the wcimClient.sh to migrate your database. The script fails with NoClassDefFoundError exception on WSLauncher.
Symptom Run the wcimClient.sh script results in the following exception:
Event: [exec] Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/ws/bootstrap/WSLauncher
Error:
Error: BUILD FAILED
Error: file:/usr/local/myco/wcs/migration/config/invokedbscripts.xml:81: exec returned: 1
Error:
Error: Total time: 0 seconds
Error:
Error: exec returned: 1
Error: WCIM has failed at com.ibm.commerce.migration.wcim.command.WCIMMigrateDBCommand
Event: WCIM is stopped since the last command failed. Cause The setupCmdLine.sh script tries to get the WebSphere Application Server directory from command line arg {0}:
CUR_DIR=`pwd`
WAS_DIR=`dirname ${0}`/../
cd "${WAS_DIR}"
WAS_HOME=`pwd`
cd "${CUR_DIR}"

The script works if it is called directly. For example:
$ ./setupCmdLine.sh
$ /usr/local/myco/WebSphere/Appserver/bin/setupCmdLine.sh

To ensure the shell variable settings are still valid after setupCmdLine.sh returns, the script is usually called like this:
. /usr/local/myco/WebSphere/Appserver/bin/setupCmdLine.sh

When using "." to execute a shell script, the content of this shell script is read and executed in the current context, so, the variable ${0} is not changed.
For example:
If the ". /usr/local/myco/WebSphere/Appserver/bin/setupCmdLine.sh" is called from
"/usr/local/myco/WebSphere/CommerceServer60/bin/configServerEnv.sh", then the command line arg "${0}" is
"/usr/local/myco/WebSphere/CommerceServer60/bin/configServerEnv.sh", so the $WAS_DIR is incorrectly set. Diagnosing the problem Add the following debug statements in bold below to the setupCmdLine.sh script.
The setupCmdLine.sh script is located in the WAS_installdir/bin directory:

else
CUR_DIR=`pwd`
echo "setupCmd: cur_dir=$CUR_DIR"
WAS_DIR=`dirname ${0}`/../
echo "setupCmd: was_dir=$WAS_DIR"
cd "${WAS_DIR}"
WAS_HOME=`pwd`
echo "setupCmd: was_home=$WAS_HOME"
cd "${CUR_DIR}"
fi

Run the migration wizard again and take note of the was_home statement that is printed to console.
The above exception will occur if the WAS_HOME variable is set incorrectly. Resolving the problem Set the variable REPLACE_WAS_HOME to WAS_HOME in the configServerEnv.sh script as follows and run the migration wizard again.
configServerEnv.sh:
... ...
if [ $OS_NAME = "OS400" ]; then
was_env=setupCmdLine
else
was_env=setupCmdLine.sh
fi

REPLACE_WAS_HOME=$WAS_HOME
... ...

The above solution will be integrated in a future WebSphere Commerce fix pack.
 

Document Information

Current web document: http://www.ibm.com/support/docview.wss?uid=swg21292853