IBM Support

wsadmin command does not return a non-zero return code in WebSphere Application Server

Troubleshooting


Problem

The wsadmin command line scripting tool does not return a non-zero return code when the specified profile name (using the -profileName parameter) does not refer to an existing profile.

Symptom

The console output of running such command:

C:\WebSphere7\AppServer>cd bin

C:\WebSphere7\AppServer\bin>wsadmin -profileName abc
WCMD0003E: The specified profile "abc" cannot be found. If a default profile exists and you wish to use it, the -profileName parameter is not required.

C:\WebSphere7\AppServer\bin>echo %ERRORLEVEL%
0

Note: It should return a error code "1" instead of "0" . This problem does not occur in UNIX platforms.

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Administrative Scripting Tools (for example: wsadmin or ANT)","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.5.5;8.5;8.0;7.0;6.1","Edition":"Base;Express;Network Deployment","Line of Business":{"code":"LOB77","label":"Automation Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
03 March 2025

UID

swg21586783