WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  wsadmin behaviour

    Posted Fri June 21, 2013 01:26 PM
    Hi all, I'm wondering if someone can help me with my wsadmin script below.  I'm having trouble with an AdminApp.install() command failing when it's populated with variables but working when it's typed explicitly and I can't see why.  Maybe a second set of eyes will help :o)

     This does work and the app installs perfectly:


    AdminApp.install(earFile, ['-appname', 'nbp-cas-CURRENT-9.1.15', '-MapModulesToServers', [['.*', '.*.war,.*', 'WebSphere:cell=WWCell,node=WWNode1,server=TestWebServer1+WebSphere:cell=WWCell,node=WWNode2,server=TestWebServer2+WebSphere:cell=WWCell,cluster=SysTest_MW_Current']], '-MapWebModToVH', [['.*', '.*.war,.*', 'default_host']]])


     

    This does not work, it fails with the error beneath the command:


    earFile = "/WebSphere/ZS0X/ear-files/ear-9.1.15.ear"
    installOptions = "['-appname', 'nbp-cas-CURRENT-9.1.15', '-MapModulesToServers', [['.*', '.*.war,.*', 'WebSphere:cell=WWCell,node=WWNode1,server=TestWebServer1+WebSphere:cell=WWCell,node=WWNode2,server=TestWebServer2+WebSphere:cell=WWCell,cluster=SysTest_MW_Current']], '-MapWebModToVH', [['.*', '.*.war,.*', 'default_host']]]"
    AdminApp.install(earFile, installOptions) 

    java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: WASX7122E: Expected "-" not found.
    ['-appname', 'nbp-cas-CURRENT-9.1.15', '-MapModulesToServe...
    ^


  • 2.  wsadmin behaviour

    Posted Mon June 24, 2013 02:53 PM
    Turns out that this works in case it's of use to people in future...

    installOptions = '[-appname ' + appName + ' -MapModulesToServers [[.* .*.war,.* ' + thisModuleMapping + ']] -MapWebModToVH [[.* .*.war,.* ' + vHost + ']]]'
     AdminApp.install(earFile, installOptions)