Applicable to ApplicationsManager Versions: v7.1,v8.0
?When Java jobs are requested in Applications Manager 8.0, most commonly using the standard AW_JAVA Program Type, they sometimes fail with 'NoClassDefFoundError' messages.
?The error mentioned was seen in the output file for the jobs. An example of an error message is below:
Exception in thread "main" java.lang.NoClassDefFoundError: connections/ConnectionManager
at java.lang.ClassLoader.defineClass1(Native Method)
at java.security.AccessController.doPrivileged(Native Method)
?This issue is seen because the Applications Manager requires and sets certain environment variables during runtime itself. Even though the job runs successfully from the command line (shell) after setting the AM environment using sosite.bat (or sosite) it fails from inside of AM because the additional environment variable(s) may overwrite the custom value(s) required by the Java job.
In order to fix this issue, unsetting the 'CLASSPATH' variable works well. This followed by setting the value of the custom 'CLASSPATH' (if required) resolves the issue. The two commands can be added using a PREFIX script specific to the job in the $AW_HOME\exec directory of the Agent where the job runs. The name of the file would be 'PREFIX.JOB_NAME' where 'JOB_NAME' is the name of the job in AM. The contents of the file would be as follows:
> cat PREFIX.JOB_NAME
The "\custom\value\for\classpath" would be the custom value as required for the job per the scripter/developer of the same.