Archive for August, 2005

Generate configuration scripts from console with WLSTScriptGenerator

Wednesday, August 17th, 2005

* Have you ever wondered if you could record all your configuration steps that you went through via the console to setup your domain and play the recorded steps to configure the same resources in different domains?

* Have you ever wondered what JMX MBean you are changing when you are clicking a checkbox in the console?

* Have you ever wondered if you could audit all the changes to your configuration (the user who started the edit session, at what time and the user who closed the edit session and at what time) ?

If your answer is Yes to any of the questions above, WLSTScriptGenerator is for you. If you never used WLST and would like to automate some WLS Administration tasks, you should start off with WLSTScriptGenerator.

Many 9.0 WebLogic Administrators are hooked to the console (well, with the new look and feel, who wouldn’t be ;) ), but there are times where you would make a bunch of changes, go through different wizards, click different buttons and setup your domain. Now if you have to go through the same process every time you setup a domain, it is time consuming and error prone. WLSTScriptGenerator lets you create a script per each edit session, the generated script will contain all the WLST equivalent commands that you can use to make same changes. The script will also contain the username who started the edit sessiion and at what time and the time and username who activated the changes.
When you start your Administration Server with WLSTScriptGenerator in front of your classpath, it will intercept each JMX call that is made to the MBeanServer and converts any change to the MBeans to a WLST command and writes it to the script, its that simple.. :-) . So, any changes via straight JMX are also converted to a WLST Script, not just the changes from the console. All the generated scripts will be saved to (DOMAIN_DIR)/wlstScripts directory.
For example, I have started an Administration server, logged into the console, created a Managed server and set the listen port. Created a Cluster and assigned the Managed Server to the Cluster. Saved my changes and activated them. If I look under my domain_dir/wlstScripts I see a jmxToWlst.py and the script generated looks something like this.
“”"
@author Copyright (c) 2004 by BEA WebLogic. All Rights Reserved.
This script is being created as part of your console/wlst/jmx interactions.
You might have to tweak this script a little bit if you may find any syntax errors.
If you find any problems, please email Satya Ghattu at sghattu@bea.com
Script Generation Begin Time: Tue Aug 16 18:37:00 EDT 2005
“”"
edit()
startEdit(0,-1,’false’)

#Script Generation Started By: weblogic

cd(‘/’)
cmo.createServer(‘ms1′)
cd(‘/Servers/ms1′)
set(‘ListenPort’,’8001′)
cd(‘/’)
cmo.createCluster(‘mycluster’)
cd(‘/Servers/ms1′)
cmo.setCluster(getMBean(‘/Clusters/mycluster’))
activate()

“”"
Script Generation Ended By: weblogic
Script Generation End Time: Tue Aug 16 18:37:52 EDT 2005
“”"

By default the scripts are always generated for every edit session when you have the wlstScriptGenerator.jar in your classpath. To disable the script generation, fire up a WLST session and connect to the Administration Server and,
edit()
startEdit()
mbs.setAttribute(ObjectName(‘com.bea:Name=WLST,Type=WLST’), Attribute(‘Recording’,'false’))
activate()

To re-enable the script generation just set the ‘Recording’ attribute on the WLST MBean to ‘true’.

I hope WLSTScriptGenerator lets you get a jump start on using WLST and help you automate your daily WebLogic Administration tasks.

_uacct = “UA-2684269-2″;
urchinTracker();

Upgrading your Security Providers to comply with WLS 9.0

Friday, August 12th, 2005

From WLS 7.0 BEA introduced a Security Framework where you can plugin your own security providers. If you have written Security Providers against your WLS 7.0 or WLS 8.1 and you are upgrading to WLS 9.0, you will also have to Upgrade these providers before you can start using them in WLS 9.0. The security providers are available to all WebLogic domains that share a WLS installation and the default location of these providers is (WL_HOME)/server/lib/mbeantypes)
The upgrade process is pretty simple, while installation BEA even upgrades any security providers that are in the default location of previous WLS installations. If you have your provider jars in a different place (say a source control), you can upgrade them by using the Security Provider Upgrade tool. To invoke the tool use, java weblogic.Upgrade -type securityproviders, this will bring up a wizard that will walk you through the upgrade process.
A few things you will have to remember before upgrading.
1) The old provider jar should have the MDF (MBean Definition File) in the jar, a MDF is the XML file that defines your Provider MBean interface. Without this MDF file the upgrade tool has no way of finding any information about your Provider.
2) You cannot upgrade security providers that came OOTB with WLS 7.0 or 8.1, becuase these are already upgraded and available OOTB with WLS 9.0.
3) Do not be alarmed if your upgraded provider jar is little bigger in size when compared to the old, this is because the Upgrade tool generates the BeanImpl’s, BeanInfo’s, Schema information etc for your provider, such that it complies with WLS 9.0 Management Framework.
4) After upgrading, you will notice that your new provider’s name has ‘_Upgraded’ appended.

All this information is very well documented on edocs.

_uacct = “UA-2684269-2″;
urchinTracker();

WebLogic 9.0 Diagnostics Framework Console Extension

Tuesday, August 9th, 2005

In WLS 9.0 BEA introduced a new WebLogic Diagnostic Service that integrates all diagnostics features and functionality into a centralized, unified framework that enables you to create, collect, analyze, and archive diagnostic data in a standard format.
Recently the WLS diagnostics team added a code sample on dev2dev, which is basically a Console extension that lets you view “critical” WebLogic Server diagnostic and monitoring information. From my initial experience it looks very promising and extremely useful.
This tool leverages two important features in WLS 9.0
1) Obviously, the WebLogic Diagnostics Framework (WLDF). You can read more about it on e-docs
2) Console Extensions. The tool uses the new 9.0 Console extension framework to augment the existing WebLogic console. You can read about writing WebLogic 9.0 console extensions also on edocs.

To install this console extension, download the zip file and unzip it to a temporary directory. Copy the diagnostics-console-extension.jar to your (DOMAIN_DIR)/console-ext directory and re-start your server, thats it! Now login to your console and you should see a WLDF DashBoard tab, click that Tab. This console extension requires the Java Plugin version 1.5, if you dont have it you will be prompted to install it.
You do not need to configure any WLDF resources to start using the WLDF console extension. The tool comes with pre-canned views that will get you started.

I would recommend any one using WLS 9.0 to check out this utility.

_uacct = “UA-2684269-1″;
urchinTracker();