Monday, February 27, 2012

Weblogic 10.3.5: Steps for Using WLST

Weblogic 10.3.5: Steps for Using WLST

Setting Up Your Environment

To set up your environment for WLST:
  1. Install and configure the WebLogic Server software.
  2. Add WebLogic Server classes to the CLASSPATH environment variable and WL_HOME\server\bin to the PATH environment variable, where WL_HOME refers to the top-level installation directory for WebLogic Server.
  3. You can use a WL_HOME\server\bin\setWLSEnv script to set both variables.
    On Windows, a shortcut on the Start menu sets the environment variables and invokes WLST (ToolsArrow symbolWebLogic Scripting Tool).
     

Invoking WLST

To invoke WLST:
  1. If you will be connecting to a WebLogic Server instance through an SSL listen port on a server that is using the demonstration SSL keys and certificates, invoke WLST using the following command:
  2. java -Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.security.TrustKeyStore=DemoTrust weblogic.WLST
    Otherwise, at a command prompt, enter one of the following commands:
    • java weblogic.WLST
    • java weblogic.WLST -loadProperties propertyFilename

Running WLST from Ant

The wlst Ant task is predefined in the version of Ant shipped with WebLogic Server and enables you to run WLST scripts from within your Ant build file.

Note: If you want to use the task with your own Ant installation, add the following task definition in your build file:

Note: <taskdef name="wlst" classname="weblogic.ant.taskdefs.management.WLSTTask" />
To run WLST from an Ant script:
  1. Set your environment in a command shell.
    • On Windows NT, execute the setWLSEnv.cmd command, located in the directory WL_HOME\server\bin, where WL_HOME is the top-level directory of your WebLogic Server installation.
    • On UNIX, execute the setWLSEnv.sh command, located in the directory WL_HOME/server/bin, where WL_HOME is the top-level directory of your WebLogic Server installation.
  2. Add a call to the wlst Ant task to execute WLST commands. For example:
  3. <target name="runwlst"> 
       <wlst fileName="./myscript.py" executeScriptBeforeFile="true"
        debug="false" failOnError="false"> 
         <script>
            connect('weblogic','weblogic','t3://localhost:7001') 
         </script>
       </wlst>
    </target>

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This error is coming when executing wlst from ant
    java.lang.NoSuchMethodError: weblogic.i18ntools.L10nLookup.getLocalizer(Ljava/util/Locale;Ljava/lang/String;Ljava/lang/ClassLoader;)Lweblogic/i18n/Localizer;

    my build.xml has made same as provided on this blog or which is as follows:


















    i have set the classpath of weblogic.jar of 10.3 but still this problem is coming.
    can you provide solution for this problem?
    Regards
    Ram Gautam

    ReplyDelete
  3. Done again after not displaying xml conent:

    This error is coming when executing wlst from ant
    java.lang.NoSuchMethodError: weblogic.i18ntools.L10nLookup.getLocalizer(Ljava/util/Locale;Ljava/lang/String;Ljava/lang/ClassLoader;)Lweblogic/i18n/Localizer;
    my build.xml is as follows:

    ;lttaskdef name="wlst" classname="weblogic.ant.taskdefs.management.WLSTTask";gt
    ;ltclasspath;gt
    ;ltpathelement location="/usr/local/bea/10.3/wlserver_10.3/server/lib/weblogic.jar" /;gt

    ;lt/classpath;gt
    ;lt/taskdef;gt
    ;ltexec executable="/bin/sh";gt
    ;ltarg value="/usr/local/bea/10.3/wlserver_10.3/server/bin/setWLSEnv.sh" /;gt
    ;lt/exec;gt
    ;lttarget name="transferDeploy12";gt
    ;ltwlst fileName="/home/oracle/.jenkins/jobs/MI_Branch_Hotfix/workspace/build/reDeploy.py" arguments="${remote.servers}" executeScriptBeforeFile="true" debug="true" failOnError="false";gt

    ;lt!--;ltscript;gt
    connect('weblogic','weblogic','t3://localhost:7001')
    ;lt/script;gt--;gt
    ;lt/wlst;gt

    ;lt/target;gt

    i have already set the classpath of weblogic.jar of 10.3 but still this problem is coming.
    can you provide solution for this problem?
    Regards
    Ram Gautam

    ReplyDelete

SOA Cloud 12c GIT Repository

When a project is created, you can choose to initialize the project with one project Git repository for the project. A Maven repository is a...