IBM Support

AdminConfig.modify() fails with WASX7123E: Unexpected "]" found error

Troubleshooting


Problem

Your attempts to execute the Jython command AdminConfig.modify() using square brackets "[" at the beginning of value fails.

Symptom

When attempting to create or update a J2EEResourceProperty using wsadmin Jython command: AdminConfig.modify(), a java.lang.IllegalArgumentException exception is returned, if the value of the property begins with the "[" character.

For example, this command:

AdminConfig.modify('(cells/ebzCell01|resources.xml#J2EEResourceProperty_1327700267852)', '[[name "test"] [type "java.lang.String"] [description ""] [value "[]"] [required "false"]]')

produces this output:

WASX7015E: Exception running command: "AdminConfig.modify('(cells/ebzCell01|resources.xml#J2EEResourceProperty_1327700267852)', '[[name "test"] [type "java.lang.String"] [description ""] [value "[]"][required "false"]]')"; exception information:

 java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: WASX7123E: Unexpected "]" found.

Attribute= had invalid value= for input parameter=]

Cause

The Parser that is being used for the AdminConfig command treats square bracket as the beginning of a list declaration, which causes the java.lang.IllegalArgumentException exception.

Environment

This issue applies to all the platforms and all the WebSphere Application Server versions that support Jython as a scripting language for wsadmin interface

Resolving The Problem

Use the administrative console to create or update the J2EEResourceProperty since it will not result in this problem using square brackets as a value.

To resolve or avoid the wsadmin exception, insert white space or blank before the square bracket "[".

For example:

AdminConfig.modify('(cells/ebzCell01|resources.xml#J2EEResourceProperty_1327700267852)', '[[name "test"] [type "java.lang.String"] [description ""] [value " []"] [required "false"]]')

[{"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":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.5;8.0;7.0","Edition":"Developer;Express;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21587193