AW_JAVA (JAVA) jobs failing with NoClassDefFoundError java error.
search cancel

AW_JAVA (JAVA) jobs failing with NoClassDefFoundError java error.


Article ID: 90432


Updated On:


CA Automic Applications Manager (AM)


When Java jobs are requested in Applications Manager, 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.lang.ClassLoader.defineClass(
 at Method)
 at java.lang.ClassLoader.loadClass(
 at sun.misc.Launcher$AppClassLoader.loadClass(
 at java.lang.ClassLoader.loadClass(
 at java.lang.ClassLoader.loadClassInternal(


CAAutomic Applications Manager


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:



export CLASSPATH="\custom\value\for\classpath"


The "\custom\value\for\classpath" would be the custom value as required for the job per the scripter/developer of the same.