Thursday Apr 02, 2015

An Introduction to WLST Script Profiles

In case you are not familiar with WLST (the WebLogic Scripting Tool), it is a powerful scripting runtime for administering WebLogic domains. Jython is used as the scripting language. Although other application servers now boast similar capabilities, WebLogic was one of the earliest to innovate this feature around 2006 with WebLogic 9. In fact, WLST maintains the most impressive set of features compared to competing offerings.

WLST is of course just one way of administering WebLogic. You can also work with WebLogic domains using Ant, Maven, the command line and of course the user-friendly admin console depending on your needs and preferences. WLST is particularly useful for automating entire deployment environments or complex administration scenarios. Matt Brasier of C2B2 Consulting (an Oracle partner) recently did an excellent talk on WLST. The slide deck for his talk is embedded below:

We also recently caught up with Peter Bowers, a key developer on the WebLogic team about WLST. He talked to us about the WLST script profile feature, including some cool sample code and a demo. Here's the video with Peter:

The best place to learn more about WLST is none other than the excellent latest WebLogic docs on the topic.

Tuesday Jan 20, 2015

WLS Tip: Introduction to WLST

WLST (WebLogic Scripting Tool) is one of the many WebLogic features that ease the management and administration of WLS instances. It is a command line based tool that can be used to create, manage, and monitor WebLogic domains.  WLST has a set of WLS specific commands (e.g. deploy an application - see here for the whole commands list), so creating WLS automated tasks is really easy. And since WLST is running on the JVM (*), those various scripted WLS taks can be easily integrated in the overall infrastructure (e.g. build platform, management infrastructure).

Mark Piller has recently written an technical introduction to WLST. In his article, Mark explains how to write WLST scripts.

You can also watch this WLST tutorial video produced by Frank Munz.

(*) Technically, WLST is using Jython on top of the JVM. 

Wednesday Aug 15, 2012

WLST Tip!

Recently, I had a question about using offline WLST to create a Capacity Constraint in a WebLogic Server configuration. The tricky part is that Constraint MBeans (and resulting configuration) are children of the SelfTuning MBean at the domain level, but the SelfTuning MBean is not listed in the configuration file by default. This behavior is the result of an optimization in WebLogic Server where the configuration file only explicitly lists objects and attributes that are defined. It does not list objects or attributes that completely governed by defaults. Take a look at the documentation at http://docs.oracle.com/cd/E23943_01/web.1111/e13715/using_wlst.htm#i1091409, which says:

"As a performance optimization, WebLogic Server does not store most of its default values in the WebLogic domain's configuration files. In some cases, this optimization prevents management objects from being displayed by WLST offline (because WebLogic Server has never written the corresponding XML elements to the domain's configuration files). For example, if you never modify the default logging severity level for a WebLogic domain while the domain is active, WLST offline will not display the domain's Log management object.

If you want to change the default value of attributes whose management object is not displayed by WLST offline, you must first use the create command to create the management object. Then you can cd to the management object and change the attribute value."

To create a Constraint object, you must first create the SelfTuning object. Here's an example that creates a new domain and then adds a Capacity Constraint to it:

C:\Oracle10.3.6\Middleware\user_projects>java weblogic.WLST

wls:/offline> createDomain('C:/Oracle10.3.6/Middleware/wlserver_10.3/common/templates/
domains/wls.jar','C:/Oracle10.3.6/Middleware/user_projects/wkmgr_domain3',
'weblogic','welcome1')

wls:/offline> readDomain('wkmgr_domain3')

wls:/offline/wkmgr_domain3>create('st','SelfTuning')

Proxy for st: Name=st, Type=SelfTuning

wls:/offline/wkmgr_domain3>cd('SelfTuning/st')

wls:/offline/wkmgr_domain3/SelfTuning/st>create('myCapacityConstraint',
'Capacity')

Proxy for myCapacityConstraint: Name=myCapacityConstraint, Type=SelfTuning!
Capacity

wls:/offline/wkmgr_domain3/SelfTuning/st>updateDomain()

wls:/offline/wkmgr_domain3/SelfTuning/st>cd('Capacity')

wls:/offline/wkmgr_domain3/SelfTuning/st/Capacity>ls()

drw-   myCapacityConstraint

wls:/offline/wkmgr_domain3/SelfTuning/st/Capacity>cd('myCapacityConstraint')

wls:/offline/wkmgr_domain3/SelfTuning/st/Capacity/myCapacityConstraint>ls()

-rw-   DeploymentOrder                               1000

-rw-   Name                                          myCapacityConstraint

-rw-   Notes                                         null

-rw-   Target                                        null

wls:/offline/wkmgr_domain3/SelfTuning/st/Capacity/myCapacityConstraint>
set('Count',50)

wls:/offline/wkmgr_domain3/SelfTuning/st/Capacity/myCapacityConstraint>
updateDomain()

That's it!

Happy scripting!


About

The official blog for Oracle WebLogic Server fans and followers!

Stay Connected

Search

Archives
« July 2015
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today