8 Replies Latest reply: Jan 4, 2013 5:00 AM by Tomas62 RSS

    WLST not obeying arguments

    667017
      I'm seeing some more strange behavior using WLST deploy. It's not using the parameters I pass in. The first case is with Plan files. I used to just give the top level directory name for the app, and it would detect the plan.xml files in the plan dir. This still works with the Admin console, but WLST never uses the Plan.xml file. I have even explicitly used the planFile parameter and it still ignores it:

      progress = deploy('myapp', '/path/to/src/file', planFile='/path/to/plan/file')

      The other issue is that it also ignores any stage mode paramater:

      progress = deploy('myapp', '/path/to/src/file', planFile='/path/to/plan/file', stageMode='nostage')

      Yet when I start the app, it complains the file is not in the staging area and the properties for the app show it's staging mode as not defined. Again, when I use the admin console it works as advertised.

      Are there known issues with WLST? It seems the admin and WLST both use the weblogic.deployer class, but only one works. Or am I possibly doing something wrong?

      Mike
        • 1. Re: WLST not obeying arguments
          yekki
          it should be planPath not planFile.
          for example:
          wls:/mydomain/serverConfig/Servers> deploy('demoApp', 'c:/myapps/demos/app/demoApp.ear', targets='myserver', planPath='c:/myapps/demos/app/plan/plan.xml', timeout=120000)

          Edited by: Gary Niu on 2009-1-15 下午8:28

          Edited by: Gary Niu on 2009-1-15 下午8:28
          • 2. Re: WLST not obeying arguments
            667017
            Thanks Gary, I actually did notice I was using the wrong argument name for the plan file. However, I still maintain that the stageMode argument is broken in WLST. I have tried every premutation of argument order, single quotes, double quotes, waiting until a full moon, etc. and got nothing. I did try breaking it down to its simplest form:

            appname = 'myapp'
            srcfile = '/path/to/src/file'
            deploy(appname, srcfile, stageMode='nostage')

            This worked! However, I need to specify libraryModule for some of our deployments, so I added:

            deploy(appname, srcfile, stageMode='nostage', libraryModule='true')

            This failed: staging mode did not get set (same result if I reversed the last 2 args). For now I am resorting to java and weblogic.Deployer until someone can prove to me WLST deploy works with stageMode, libraryModule, planPath, and targets.
            • 3. Re: WLST not obeying arguments
              yekki
              It seems that the named arguments don't work well in WLST.
              You'd better input all arguments. On the other hand, I don't know where do you find so many strange arguments
              for example, isLib. You'd better take the following document for reference.

              http://e-docs.bea.com/wls/docs103/config_scripting/reference.html#1024285
              • 4. Re: WLST not obeying arguments
                yekki
                It seems that the named arguments don't work well in WLST.
                You'd better input all arguments. On the other hand, I don't know where do you find so many strange arguments
                for example, isLib. You'd better take the following document for reference.

                http://e-docs.bea.com/wls/docs103/config_scripting/reference.html#1024285
                • 5. Re: WLST not obeying arguments
                  678937

                  The support of optional arguments in the WLST deploy command actually does work, but it is very convoluted to figure out from the terse WLST reference documentation. The key to the problem is that any params beyond appName, path, targets, stageMode, and plan need to be passed as a dictionary of key-value pairs (it looks like you were trying to pass optional params as a comma separated list (i.e. "libraryModule=true"). Here is a snippet example from a working Jython based WLST application that I developed for a client and is currently used in their production env:

                  # wlst.deploy signature: deploy(appName, path, targets, stageMode, plan, [options])
                  # In this example:
                  # appName = "testApplication"
                  # path = "c:/mydeployments/v2.0"
                  # targets = "ProductionCluster"
                  # stagedMode = "nostage"
                  # plan = "" (no plan for my example so passing empty string)
                  # options = dictionary of optional key-value pairs (created below)

                  #create dictionary of optional key-value pairs to pass to the deploy() method
                  options = {}
                  options.setdefault("libraryModule", "true")

                  progress = wlst.deploy("testApplication", "c:/mydeployments/v2.0", "ProductionCluster", "nostage, "", **options)

                  • 6. Re: WLST not obeying arguments
                    844923
                    I think the issue you were running into with with libraryModule='true' is that with the single quotes it is considered a string and wlst is expecting boolean true/false value. It works for me with the following syntax .

                    deploy(appname, srcfile, stageMode='nostage', libraryModule=true)

                    or like this with a variable
                    wlLibraryModule=true
                    deploy(appname, srcfile, stageMode='nostage', libraryModule=wlLibraryModule)

                    Rob
                    • 7. Re: WLST not obeying arguments
                      925535
                      I'm facing a similar problem. The relevant code is as follows:

                      m_stageMode="stage"
                      deployName=''TestModule"
                      fullPath="/files/test_module.war"
                      m_targets="server01"
                      options = {"upload":"true", "versionIdentifier":"2_2_5_29"}
                      deploy(deployName, fullPath, m_targets, m_stageMode, **options)

                      The stageMode parameter is ignored. The file isn't copied to the target's stage directory and the console shows "Staging Mode: (not specified)". All other parameters are being properly honored. Am I doing something wrong?

                      Using WebLogic Server version 10.0 mp1
                      • 8. Re: WLST not obeying arguments
                        Tomas62
                        I'm a bit late into this discussion but figured I'd contribute my findings anyway. I've been struggling with this also, on WLS 10.3.3.
                        I could not get this to work:
                        deploy(libname, libfile, stageMode='external_stage', libraryModule=true)

                        Or rather, it deploys but as a web app rather than a lib... An annoying quirk is that "true" for libraryModule has to be without quotes but the stagemode value has to be specified with quotes.

                        However, this worked fine:
                        options = {}
                        options.setdefault("libraryModule", "true")
                             progress = deploy(libname, libfile, target, 'external_stage', "", **options)

                        /Tomas

                        Edited by: Tomas62 on Jan 4, 2013 11:59 AM