Just tried this thing for a day or two, able to do the installation using AdminApp command, but still got some problem about application name and installation path.
Reference I look from IBM said AppName is defined by display name, I think that mean it use the display name field from web.xml? But the result that I see is the application name will look like "Test_AP.war16dfd74ab1a", not exactly the same.
The installation path parameter part is also ambiguous, I don't think I see a thing looks like it.
import time
AdminApp.install('C:/Users/Development/Desktop/Test_AP.war', '-cell WIN-9DAB2SINode01Cell')
AdminConfig.save()
result = AdminApp.isAppReady('Test_AP')
while (result == "false"):
### Wait 5 seconds before checking again
time.sleep(5)
result = AdminApp.isAppReady('Test_AP')
print("Starting application...")
What I try to achieve is to use this script to install my service onto WAS with exact application name(same as my WAR name or display name in web.xml) and designated installation path, then start the service. But now I'm stuck at com.ibm.ws.scripting.ScriptingException: WASX7280E: An application with name "Test_AP_WAR" does not exist
. Can anyone tell me how to do this?
You need to include an -appname
argument such as:
AdminApp.install('C:/Users/Development/Desktop/Test_AP.war', ['-cell WIN-9DAB2SINode01Cell' -appname SimpleTestConnection5_war])
Otherwise WAS will generate an application name for you.
Create an AdminApp.install
command using the Admin Console. Install an enterprise application using the WAS Admin Console. On the last page, you will see a help box in the upper right corner. Click on view administrative scripting
and you will be provided with an AdminApp.install
command. This command can be edited with a custom location and appname.