How to install (or remove) EAR in WebSphere Application Server v.8.5 through the command line using wsadmin?

Instead of going through the administration console which is tedious, I would prefer to install and uninstall my Java application (EAR) through the command line saved as a shortcut in Windows.

Note that I am running WebSphere Application Server v8.5 on Windows , so I need DOS commands , not Unix . > those.

+4
source share
2 answers

To run any team with one shot in wsadmin you can:

wsadmin -lang jython -c <command>

script wsadmin, :

wsamdin -lang jython -f <script_file_name>

, , AdminConsole, " " " ". , wsadmin , WAS.

, myapp.war , :

AdminApp.install('myapp.ear', '[ -nopreCompileJSPs -distributeApp -nouseMetaDataFromBinary -appname myapp-createMBeansForResources -noreloadEnabled -nodeployws -validateinstall warn -noprocessEmbeddedConfig -filepermission .*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 -noallowDispatchRemoteInclude -noallowServiceRemoteInclude -asyncRequestDispatchType DISABLED -nouseAutoLink -noenableClientModule -clientMode isolated -novalidateSchema -MapModulesToServers [[ myapp_Web myapp.war,WEB-INF/web.xml WebSphere:cell=myCell,node=myNode,server=server1 ]] -MapWebModToVH [[ myapp_Web myapp.war,WEB-INF/web.xml default_host ]]]' ) 

:
, wsadmin, , / script - .

+2

, installApplication.py, :

AdminApp.install('<path_to_application>/application.ear','[-node nodeName -cell cellName -server serverName]')
AdminConfig.save()

. [: ].

, installApplication.bat. wsadmin, script:

<path_to_WAS_profile>/bin/wsadmin.bat -lang jython -f <path_to_py_file>/installApplication.py

, .


uninstallApplication.py script :

AdminApp.uninstall('<application_name>')
AdminConfig.save()

:

<path_to_WAS_profile>/bin/wsadmin.bat -lang jython -f <path_to_py_file>/uninstallApplication.py

, , . installApplication.py script :

AdminApp.install('<path_to_application>/application.ear', '[-cluster cluster1]')
AdminConfig.save()
AdminNodeManagement.syncActiveNodes()

wsadmin.bat .

. , :

AdminApp.uninstall('<application_name>')
AdminConfig.save()
AdminNodeManagement.syncActiveNodes()
+3

Source: https://habr.com/ru/post/1662351/


All Articles