1

I'm trying to write a script to deploy an application to Websphere using the wsadmin.sh scripting tool. I am able to do it directy on the command line like this:

$AdminApp install c:\someFolder\someEar.ear {-MapModulesToServers {{.* .* WebSphere:cell=cellName,node=nodeName,server=serverName}}}

Now I'm trying to do the same by running a python module.

This works (so without the MapModulesToServers option):

AdminApp.install("c:\someFolder\someEar.ear")

Now I'm trying to add the MapModulesToServers option and no matter what I try I get the error 'IllegalArgumentException: WASX7122E: Expected "-" not found.'

I've tried googling for this message but haven't been able to find a solution. Some of the syntax I've tried:

AdminApp.install('c:/someFolder/someEar.ear', '[-MapModulesToServers [WebSphere:cell=mycell,node=mynode,server=server1]]')

This one was taken straight from the commandAssistanceJythonCommands_admin.log after manually deploying in the console. So this is the syntax that websphere produced for my ear:

AdminApp.install('C:/someFolder/someEar.ear', '[-nopreCompileJSPs -distributeApp -nouseMetaDataFromBinary -nodeployejb -appname csiva-ear -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 [["Wicket Examples" someWar.war,WEB-INF/web.xml WebSphere:cell=cellName,node=nodeName,server=serverName]]]')

Any help would be greatly appreciated.

M I P
  • 867
  • 10
  • 25
OO-Mango
  • 35
  • 6

1 Answers1

0

So did you actually tried shortened suggested version like this:

 AdminApp.install('C:/someFolder/someEar.ear', '[-MapModulesToServers [["Wicket Examples" someWar.war,WEB-INF/web.xml WebSphere:cell=cellName,node=nodeName,server=serverName]]]')

and make sure to either save it in the *.py file if you invoking wsadmin with -f option, or start wsadmin with jython language as:

wsadmin.bat -lang jython

I've just tested it in my env and this is working fine:

AdminApp.install('c:/SampleApp.ear', '[-MapModulesToServers [[ SampleApp Sample1.war,WEB-INF/web.xml WebSphere:cell=was855Node02Cell,node=was855Node02,server=server1 ]] -MapWebModToVH [[ SampleApp Sample1.war,WEB-INF/web.xml default_host ]]]' ) 
Gas
  • 17,601
  • 4
  • 46
  • 93