Troubleshooting
Problem
You cannot define IBM WebSphere Application Server variables for a cluster using wsadmin. Defining variables for a server using wsadmin can be done easily with the following commands:
#getting the varMap
wsadmin>set varMap [$AdminConfig getid /Node:
Symptom
For a cluster:
wsadmin>set a [$AdminConfig getid /ServerCluster:/]
arztest(cells/tcwas601/clusters/arztest|cluster.xml#ServerCluster1118831111774)
wsadmin>set b [$AdminConfig list VariableMap $a]
The second command returns nothing. A reference to the VariableMap object is not found.
Cause
When a cluster is created, no variables.xml file is created in the /config/cells/<cell_name>/clusters/<cluster_name>/ directory. Therefore, commands referencing this object, VariableMap, will not work.
Resolving The Problem
You must first create varaibles.xml file in the following directory:
/config/cells/<cell_name>/clusters/<cluster_name>/
To do so, use the $AdminConfig createDocument command, as follows:
wsadmin>$AdminConfig createDocument cells/<cell_name>/clusters/<cluster_name>/variables.xml "C:\\<was_home>\\profiles\\Dmgr01\\config\\templates\\servertypes\\APPLICATION_SERVER\\servers\\default\\variables.xml"
Now that a variables.xml has been created, reference it using the 2 commands as before:
wsadmin>set a [$AdminConfig getid /ServerCluster:/] cluster1(cells/ibmCell01/clusters/cluster1|cluster.xml#ServerCluster_110778999)
wsadmin>set b [$AdminConfig list VariableMap $a] (cells/ibmCell01/clusters/cluster1|variables.xml#VariableMap1118754715594)
Then use the VariableSubstitutionEntry command to define your variables:
wsadmin>set attrs [list [list symbolicName Test] [list value 10]]
wsadmin>$AdminConfig create VariableSubstitutionEntry $b $attrs
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21211031