如何通过wsadmin.bat与AdminApp在WebSphere中安装EAR应用?
Let's break down your problem and walk through solutions step by step:
1. Resolving the ADMA0043E Error
The error ADMA0043E: C:\Users\Administrator\AppData\Local\Temp\app9157482086909190098.ear does not exist typically stems from two issues:
- The WebSphere AdminAgent process can't access your local EAR file path (either due to permission restrictions, or if the AdminAgent runs on a remote node).
- A typo in your EAR filename (I noticed you wrote
my-applicaiton.ear– double-check if that's a typo missing an 'l' in "application"?).
The fastest fix is adding the -upload flag to your command. This forces wsadmin to upload your local EAR file directly to the WebSphere server's temporary directory, bypassing cross-node or permission barriers:
C:\WSAS\bin>wsadmin.bat -user alex19 -password qwerty19 -c "AdminApp.install('C:/ear/my-application.ear', ['-upload'])" -lang jython
If the typo wasn't the issue, also verify that the Windows user running the AdminAgent has read/write permissions to C:\Users\Administrator\AppData\Local\Temp.
2. Using Property Files and Deployment Plans
Passing a Property File
Property files let you define reusable deployment parameters (like app name, target node/server, context root) in a plain text file. For example, create app-install.props with:
appname=MK.MyApplication node=KSDD server=server1 contextroot=/myapp
Reference it in your install command with the -properties flag:
C:\WSAS\bin>wsadmin.bat -user alex19 -password qwerty19 -c "AdminApp.install('C:/ear/my-application.ear', ['-upload', '-properties', 'C:/config/app-install.props'])" -lang jython
Using a Deployment Plan
If you have a custom deployment plan (e.g., modified application.xml, EJB descriptors, or WebSphere-specific bindings), use the -deployplan flag to specify its path:
C:\WSAS\bin>wsadmin.bat -user alex19 -password qwerty19 -c "AdminApp.install('C:/ear/my-application.ear', ['-upload', '-deployplan', 'C:/config/my-deployment-plan.xml'])" -lang jython
Bonus: View All Install Options
To see every available parameter for AdminApp.install(), run this command to get a full list:
C:\WSAS\bin>wsadmin.bat -user alex19 -password qwerty19 -c "print AdminApp.options('-install')" -lang jython
内容的提问来源于stack exchange,提问作者katesh

