Search This Blog

Thursday, June 5, 2014

Advanced WebLogic Server Automation : Book Review

Great news for WebLogic users, administrators. The first WLST and JMX book now available in the market and online!! Almost 2 years of efforts. Here I am happy to share my first interaction with the author Martin Heinzl


First review and foreword of Advanced WebLogic Server Automation book

I started working on Jython automation in 2009. That time there were very few online forums  such as StackOverflow on the automation scripts. Most documents where either insufficient or with same repeated contents. I thought why not to start a WLST community to help JEE application users who uses WebLogic as application server. Initially starting with the first prominent social network “Google’s Orkut”,  I created the WLST community and started  working on various Jython scripting issues and initiatives to automate the WebLogic administration tasks. Now it was It’s the time for new social network, like where Linkedin which is exclusively developed for professionals. I have opened a ‘WLST’ group, later renamed to ‘WLST by Examples’. It has continuous growing Middleware experts who are looking for WLST. Here is where I first time saw Martin Heinzl discussion posting on the group with "Work-in-progress: Weblogic automation book”.  We both had exchange of thoughts on the book to come up with the best. 

Martin is my and many more aspirants’ mentor, guide. Martin is endowed with an ocean of profound automation knowledge and the best part is, Martin never hesitates to share   his thoughts and suggestions. The book is having three parts, part 1 gives you the intent of the each part and why you need to choose  that part. 

The way WLST is developed from WebLogic 8.1 onwards, enhancing with new features with every new released version 12c to be more user friendly and efficient. WebLogic Jython implementation with robust scripting capabilities is much better than other application server in the JEE market.
The second part is a deep dive of Jython scripting for the WebLogic configurations, deployment, and monitoring, tuning concepts. Whereas Oracle developing the strategies to stand in the number one position in the Middleware market with huge scope on cloud computing focused in WebLogic 12c suite. The business People changed and they are looking for cost-cutting options with private or public clouds. Oracle Fussion Middleware suite come with SOA, BPEL, Developer, WebCenter suites. 

The third part is JMX, it is targeted for those who are already know the Java programming. If you are thinking ‘What if there is a better way than using Jython for WLST?’  Then this is part to refer. I am a JMX newbie. I ran through this part and understood the greatness of the JMX. It has achieved many of the technical goals that JMX API strives for.

Martins ‘Advanced WebLogic Server Automation’ book will be a perfect  guide for experience and novice WebLogic users. The book is formatted with focus on many real-life scenarios, most of the WebLogic administrators, architects use them. This book enables those Administrators to work on automation to save their productive hours.  I liked Martin way of explanation, motivation to readers, and in-detailed orientation for each scenario. Hope I forever remain shadowed under his exorbitant wisdom. 

The book starts from the nothing to building blocks for the enterprise architecture with dynamic automations with fine intent to grow or customized further for the technical needs.

Specifically I wondered for the JMX part, where it covered various resource configurations and also equally had the monitoring capabilities that it does with WLST.  One requires good knowledge on 

Java programming and also idea on JMX APIs.
The book is one place to find most of the Jython scripting for effective system administration on WebLogic suites and shows the greater automation power. And not to forget the way the book is drafted as “Simplicity at its best ". 

Thank you Martin for being guide with great book ‘Advanced WebLogic Server Automation’.

My friends from Oracle Sunil Nagavelli, and Rakesh Panigrahi from Amdocs shared their thoughts and inputs to make this great draft for Preface of the Book. 



Monday, August 19, 2013

Invoking WLST from Ant

There are many Middleware Admins who knows do build and deployment out there using Ant to automate their Oracle Fusion Middleware suite configurations on WebLogic domain. and if you would like to embed your WLST configuration scripts into your ant build.xml script files, you can certainly do so. This is simple and easy task which I suppose to post it long back :)

Invoking WLST from a build.xml


Invoking WLST from ANT Script

We can use the WLST script within the build.xml that is between
The other option is you can develop a WLST script in regular fashion, invoke with script path.
We can use both of them part of ANT script(build.xml) invokes part of WLST individual file(.py) then there would be priority which part must be executed first that we can handle with the attribute 'executeScriptBeforeFile' by default it is true you can use false when you don't want.

There are situations where you need to invoke the WLST script from ANT script. There are following possibilities:

  • configure WebLogic resources with ANT
  • Server Control using ANT
  • Monitoring using ANT
The main advantages of using 'WLST with ANT' comes when there is complete templatization of the WebLogic domain configurations for heavy resource configurations as part, such as JMS Resources, JDBC datasources, Message Bridges etc.,

Sample WLSTbuild.xml



  
  
  
    
      
    
  
 
  
    
        
    
   


Sample WLSTbuild.properties file

Now create a properties file say wlstbuild.properties that initialized in the ant script with property element.
weblogic.home.dir=C:/Oracle/Middleware/wlserver_10.3
weblogic.lib.dir=${weblogic.home.dir}/server/lib
wlst.script.source=C:/pbin/test.py

Sample Python script invoked in ant script

The test.py WLST Script will fetch the Server list online WLST.
# Started recording all user actions at Tue Dec 18 22:41:59 IST 2012
svrs = cmo.getServers() 
print 'Servers in the domain are' 
for x in svrs: 
        print x.getName()

How to invoke WLST from ant?

Here the pre-requisite to run the ant script assumed that the WebLogic domain already created and Running fine. Some of the build experts prefer to start internal targets with dashes just to make sure users cannot run them from the command line. In fact, I make it a standard practice to have all internal targets start with - just for this reason. You can try the old double-dash trick. I don't have Ant installed on my current system, so I can't test it. Double dashes is a common Unix trick that most commands use to help end parameters when you have files and stuff that start with a dash. By the way, the tasks should be the last thing on your command line:
$ ant -f wlstbuild.xml -- -stopservers
Targets beginning with a hyphen such as "-stopservers" is valid, and it can be used to name targets that should not be called directly from the command line. Usually, it would be called by someother target such as app-deployment depends on targets as -stopapp, -undeploy, -deploy, -startapp, -stopservers, -startservers etc.

To invoke you need to run the setWLSEnv.sh/cmd
prompt$ ant -f wlstbuild.xml
Running ant embed WLST script

Popular Posts