I need to deploy an EAR file that is located in sever A to a WebSphere Server located in server B. I need to know how to deploy the EAR from server A to my WAS through command line. I have seared the web but found results only fro WAS 6 (i have WAS 7). does any one know how to deploy an EAR to WAS (in a different server) through command line?
2 Answers
I assume both servers are standalone. If so, use WAS_HOME/bin/wsadmin on server A, and specify the RMI host/port for serverB. If not, specify the host/port of the deployment manager for serverB.
wsadmin -host serverB.host.com -port serverBRMIPortNumber -c '$AdminApp install /path/to/localfile.ear {...options...}'
Note, this is UNIX syntax; for Windows syntax, use "double quotes". Alternatively, you can omit the -c and use interactive mode, or you can use -f file.jacl. Jython scripting is available with -lang jython. See the following for AdminApp install options (e.g., -appname or -usedefaultbindings):

- 33,593
- 2
- 85
- 90
-
how do I deploy WAR file with commandline? passing contextroot also. Pls help – Mohamed Saligh Dec 08 '11 at 05:59
-
$AdminApp install /path/to/localfile.war {-contextroot whatever ...more options...} – Brett Kail Dec 08 '11 at 15:55
-
does this require the ear file to be packaged ? i am on a windows computer and have a project with an EarContent directory. Do I have to package it into an EarFile first? – mjs Jan 13 '12 at 15:22
-
I don't think it needs to be packaged, though I've not tried it myself. If you do try, please add a comment. – Brett Kail Jan 13 '12 at 23:59
You should really consider a nodeagent, that would make all of this go away. I'm assuming you're not in a clustered environment, otherwise a simple push to and synch of a nodeagent would do the trick.
The answer above is correct, but you could also simply FTP the package to be deployed to serverB and just use wsadmin to install locally, as well.

- 86,916
- 18
- 197
- 190

- 1
- 1