IBM Support

WebSphere Application Server v6.x ws_ant.bat error: The java class is not found when running Ant

Troubleshooting


Problem

WebSphere Application Server v6.x ws_ant.bat error: The java class is not found: occurred on a Microsoft Windows 2003 machine on which WebSphere Application Server v6.1.0.23 was just installed.

Symptom

WebSphere Application Server v6.1.0.23 ws_ant.bat error occurred as shown without any class name mentioned.

The java class is not found:


Although wsEjbDeploy was in the ws_ant script, running just the ws_ant.bat without any arguments, results in the the same error.

Cause

In this case, the error occurred because there was no default profile created for this WebSphere Application Server v6.1 install.

Note: WebSphere Application Server 6.1.0.23 has a known defect APAR PK45126: STOPSERVER ANT API CASED JAVA CLASS IS NOT FOUND, but this is not the problem

Environment

This error could occur on any Operating System and any server edition.

Diagnosing The Problem

Consider below the scenario/results from WebSphere Application Server (WAS) 6.1.0 on any supported Windows platform:

No profile:

{WAS v6.1 HOME Install dir}\bin>manageprofiles -listProfiles

[]

{WAS v6.1 HOME Install dir}\bin>ws_ant.bat

The java class is not found:


Create a default profile with default options:

{WAS v6.1 HOME Install dir}\bin> manageprofiles -create -templatePath {WAS v6.1 HOME Install dir}\profileTemplates\default

INSTCONFSUCCESS: Success: Profile AppSrv01 now exists. Please consult {WAS v6.1 HOME Install dir}\profiles\AppSrv01/logs/AboutThisProfile.txt for more information about this profile.

Note: In the case of WebSphere Application Server Network Deployment edition, There are two profile templates that are used to create one cell (which is actually two profiles). the templates are WAS_HOME/profileTemplates/cell/dmgr and WAS_HOME/profileTemplates/cell/default. Contact IBM WebSphere server support if assistance is needed


Rerun, and get a "meaningful" error message. In this case a buildfile was not provided, and the default build.xml was not there:

{WAS v6.1 HOME Install dir}\bin>ws_ant.bat

Buildfile: build.xml does not exist!

Build failed


Running something similar to this should show if there is no default profile.

Resolving The Problem

Creating a profile resolves this specific scenario. This applies to nay WAS server version.

Note: As of WebSphere Application Server v7.0.0.x there is an improved/informative error message instead of just: The java class is not found:

Note: ws_ant cannot be used in IBM Rational Application Developer (RAD). It can only be used with WAS outside of RAD.

[{"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Ant","Platform":[{"code":"PF033","label":"Windows"},{"code":"PF016","label":"Linux"}],"Version":"6.0;6.0.0.1;6.0.1;6.0.1.1;6.0.1.2;7.0;7.0.0.1;7.0.0.10;7.0.0.2;7.0.0.3;7.0.0.4;7.0.0.5;7.0.0.6;7.0.0.7;7.0.0.8;7.0.0.9;7.5;7.5.1;7.5.2;7.5.3;7.5.4;7.5.5;7.5.5.1;7.5.5.2;7.5.5.3;7.5.5.4;7.5.5.5;8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.4.1;8.0.4.2;8.0.4.3;8.5;8.5.1;8.5.5;8.5.5.1;8.5.5.2;9.0;9.0.1;9.0.1.1;9.1;9.1.0.1;9.1.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Administrative Scripting Tools (for example: wsadmin or ANT)","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"6.1.0.23","Edition":"Base;Developer;Network Deployment;Single Server","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21381935