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.  MapModulesToServers with pattern matching

    Posted Tue May 22, 2012 05:23 PM
    I'd like to deploy an application using jython and I need to use pattern matching to map the server modules.  I got this directly from IBM info center:

    AdminApp.install(application.ear '[other options -MapModulesToServers [['.*', '.*', 'WebSphere:cell=mycell,cluster=mycluster']]

    but I keep getting the following error:

    wsadmin>wsadmin>wsadmin>wsadmin>wsadmin>Traceback (innermost last):
      (no code object) at line 0
      File "", line 3
             AdminApp.install(application.ear '[other options -MapModulesToServers [['.*', '.*', 'WebSphere:cell=mycell,cluster=mycluster']]

    SyntaxError: invalid syntax

    and it has a little pointer at the first '.*'

    I am soooo close, I can feel it!!   Any suggestions?

    Thanks in advance


  • 2.  MapModulesToServers with pattern matching

    Posted Tue May 22, 2012 06:39 PM
    Hi Danielle,


      looking your example and infocenter example i find diferences:

    AdminApp.install(application.ear '[other options -MapModulesToServers [['.*', '.*', 'WebSphere:cell=mycell,cluster=mycluster']]

    AdminApp.install('DefaultApplication.ear', ['-appname', 'TEST',  '-MapModulesToServers', [['.*','.*', 'WebSphere:cell=myCell,node=myNode,server=myServer']]])

      take in mind '  ' and how many parameters and [] do you have open and close

      only one question how are you developing the scripts?

      I use normally Application Asembly Tool (AST) from WAS v7 the name i think that is Rational.... this tool is very useful to develop scripts and to test it.  From my point of view is very usefull to check the wsadmin objets and functions and to know the correct sintax.  comes with WAS.

      of course you can do them with notepad



  • 3.  MapModulesToServers with pattern matching

    Posted Fri May 25, 2012 01:04 PM
    Yeah, the syntax for the AdminApp.install command I was using is from WAS 6.1. I added the ' ' around the MapModulesToServers param but perhaps I need to do it for all of the params and all of the variables, hmmmm.....

    I'm using VI editor and it's a PITA.  I put in a request to our software group for ASTK 7 so hopefully I'll have it soon.

    Thanks for all your help!!!


  • 4.  MapModulesToServers with pattern matching

    Posted Sat June 02, 2012 10:41 PM
    Hi Danielle,

      are you indenting the lines before for, while, if...etc you need to put one space indented to the rigth.

      I have done and script with vi and i have the same problem of SyntaxError I know that the script is working because i use more than one time, and finally i have see that the problem are the indents.

      jython need indents.

      The problem of do always the scripts with AST

      Hope this helps

    reagards


  • 5.  MapModulesToServers with pattern matching

    Posted Wed October 03, 2012 06:01 PM
    Eureka!!!

    Ok so if anyone was wondering, the answer to this issue was in my properties file.  Instead of placing the entire wildcard in the properties file like this:

    sm =[['.*','.*', 'WebSphere:cell=cellname,cluster=clustername']]

    I had to just define the variable in the properties file like this:

    sm=WebSphere:cell=cellname,cluster=clustername

    and then add the wildcard in the actual script like this:

    '-MapModulesToServers', [['.*','.*', sm]]

    Brilliant!!!

    Thanks Gabriel for the help and encouragement!!


  • 6.  MapModulesToServers with pattern matching

    Posted Wed October 03, 2012 07:16 PM
    Michelle,

      !!!! You're a machine !!!!

       Thank you very much for sharing the solution. You are script Master

    Kind regards,


  • 7.  MapModulesToServers with pattern matching

    Posted Thu October 04, 2012 02:28 PM
    Thanks Gabriel!!!

    Check out my blog for the full script....

    Danielle