search cancel

Error running Java .class in Applications Manager v8.0 SP13 and later

book

Article ID: 90241

calendar_today

Updated On:

Products

CA Automic Applications Manager (AM)

Issue/Introduction

Error running Java .class in Applications Manager v8.0 SP13 and later

Environment

Release: AAMOS499000-8.0-Automic Applications Manager-OS400 Agent
Component:

Resolution

Detailed Description and Symptoms

After creating a new Java program with a .class extension the following error is encountered:

++ java <program_name>.class 
Exception in thread "main" java.lang.NoClassDefFoundError: <program_name>/class 
Caused by: java.lang.ClassNotFoundException: <program_name>.class 
at java.net.URLClassLoader$1.run(Unknown Source) 
at java.security.AccessController.doPrivileged(Native Method) 
at java.net.URLClassLoader.findClass(Unknown Source) 
at java.lang.ClassLoader.loadClass(Unknown Source) 
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) 
at java.lang.ClassLoader.loadClass(Unknown Source) 
Could not find the main class: <program_name>.class. Program will exit. 
++ exit 1 


Investigation

When creating a Standard Job in Applications Manager using the AWJAVA Program Type you can "Select" the correct program from the list which will add the file name and extension to the "Program Name" field.

In order to properly run the .class job using AWJAVA the extension should not be part of the Program Name.


Solution

Edit the job and and remove the .class extension from the "Program Name" field in the "General" tab.