IBM Support

java.lang.NoClassDefFoundError is thrown from a wsadmin task invoked from within ant when ws_ant launcher is not used

Troubleshooting


Problem

If ANT script launched with non IBM supported launcher other than ws_ant, java.lang.NoClassDefFoundError exception can be thrown.

Symptom

If ANT build script is invoked with launcher(from Apache, maven, ...) and not from IBM provided ws_ant.sh(bat) launcher, the following exception might be thrown:

[time stamp] 00000001 AbstractShell E WASX7120E:
Diagnostic information from exception with text
"com.ibm.websphere.management.application.client.AppDeploymentException:
[Root exception is java.lang.NoClassDefFoundError:
javax.annotation.sql.DataSourceDefinition]

Cause

Starting from WAS v8.0 release, ws_ant.sh(bat) launcher script includes "-Djava.endorsed.dirs" java system property to set the path for java endorsed jar files to implement "Java Endorsed Standards Override Mechanism" by Oracle http://docs.oracle.com/javase/7/docs/technotes/guides/standards/).
Since non IBM supported ANT launcher scripts do not include this path, it causes java.lang.NoClassDefFoundError exception

Environment

All

Resolving The Problem

The recommendation is to use IBM supported ANT launcher script ws_ant.sh(bat) to launch ant scripts. If customers can not use ws_ant for some reason, they need to fix their tool by setting "-Djava.endorsed.dirs" path to $WAS_HOME/endorsed_apis directory.

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Deploy (for example: AAT or ANT or EAR\/WAR\/JAR)","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.5.5;8.5;8.0","Edition":"Base;Express;Network Deployment;Single Server","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21672068