Archive for September, 2005

Thursday, September 29th, 2005

All about Silos
I am at BEAWorld and trying to salvage as much information as I can from the key notes and sessions. One interesting keyword I kept hearing and saw sprinkled all over the keynotes is “silos”. Here’s a literal dictionary meaning of silos, “A tall cylindrical structure, usually beside a barn, in which fodder is stored”. Well, this is not exactly what the keynote speaker’s meant.. ;) . In technical terms silos mean applications, data or software’s that are built monolithically and do not participate in any common software infrastucture a company might have. The strong message from the keynote speakers at BEAWorld that kept resonating is that the BEA AquaLogic product family provides software that will let you connect disparate and unsynchronized silos of applications by employing an integration architecture and SOA to help unify a sprawling infrastructure.

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

WLS 9.0 Management API – Part 2

Monday, September 12th, 2005

In my last blog we discussed what we had to manage WLS prior to 9.0. There are many changes in 9.0, few important changes are, Management API based on JMX 1.2, adopted to JSR 160 and new functionality aligned MBeanServers. JSR 160 defines the remotable API for JMX, making it possible for clients to connect to a remote JMX MBeanServer without any proprietary classes in the classpath. By the way, Sun now bundles JMX 1.2 with JDK 1.5 (i.e. JMX classes are in the boot classpath). Since we have a standard way to remotely connect to a JMX Agent, BEA deprecated its Remotable extensions MBeanHome and RemoteMBeanServer. BEA also deprecated the type-safe stubs that MBeanHome used to return when you lookup an MBean and now recommends using straight JMX or WLST. With 9.0 the config.xml is schema based which lets users to use tools like XMLSpy to edit the configuration offline. Prior to 9.0, we had only one MBeanServer that hosted all MBeans (Configuration, Runtime & Custom). In 9.0 WLS has four MBean servers, each of which provides access to different MBeans depending on their functionality. The Edit MBean Server provides access to the editable configuration MBeans, the Domain Runtime MBean Server provides federated access to all Runtime MBeans and read-only configuration MBeans in the domain, the Runtime MBean Server provides access only to the Runtime and read-only configuration MBeans and the Compatibility MBeanServer provides access to all deprecated MBeans.
Let us make a one-one comparison between WLS prior to 9.0 and 9.0.

WLS Management from 6.0 to 8.1 WLS Management from 9.0 & above
Proprietary Remotable APIs to access MBeanServer Standards based, JSR 160. Deprecated MBeanHome & RemoteMBeanServer
One MBeanServer, hosted all MBeans 4 MBeanServers, each MBS hosts MBeans depending on functionality
Non schema based config.xml Schema based config.xml
Many broken links in MBean hierarchy All MBeans completely Linked, making the hierarchy traversable
MBeanHome – Factory for creation/deletion of all MBeans Each parent MBean serves as a Factory to create/delete its Child MBeans
Configuration change mechanism is atomic Introduction of transaction semantics to configuration change
No control over configuration changes and often unpredictable Need a lock on configuration to make a change, more control (can undo changes, stop edits etc)
AdminMBeanHome provided the federated view of the Domain DomainRuntime MBeanServer provides the federated view of the Domain
CommandLine administration via weblogic.Admin Deprecated weblogic.Admin, introduced WLST
WebLogic Domain Name in MBean’s ObjectName, ex: mydomain:Name=myserver,Type=Server Changed to com.bea, ex: com.bea:Name=myserver,Type=Server
config.xml represented all WLS configuration {domain_dir}/config directory represents WLS configuration i.e config is spread across multiple xml files (JMS, JDBC & WLDF config in different files)
None Service MBeans to get to the root MBeans


Now here’s what you will do in WLS 9.0 to get to the ServerMBean.
// All JMX imports that you need
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;

// Assuming you know these
String protocol = “t3″; // can be t3, http, iiop
String hostname = “localhost”;
int port = 7001;
String uri = “/jndi/” +”weblogic.management.mbeanservers.runtime”;
// Create a JMX Service URL
JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port, uri);
// Setup connection properties
Hashtable h = new Hashtable();
h.put(Context.SECURITY_PRINCIPAL, user);
h.put(Context.SECURITY_CREDENTIALS, password);
h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, “weblogic.management.remote”);
// this one points to a BEA class
// Create a connection to the RuntimeMBeanServer
JMXConnector connector = JMXConnectorFactory.connect(serviceURL, h);
// Get the RuntimeMBeanServer
MBeanServerConnection connection = connector.getMBeanServerConnection();
// Get the Runtime Service MBean
ObjectName service = new ObjectName(“weblogic:Name=RuntimeService”);
// Get the Domain MBean
ObjectName domain = (ObjectName) connection.getAttribute(service,”DomainConfiguration”);
// Get the ServerMBean
ObjectName server = (ObjectName) connection.getAttribute(domain,”ServerConfiguration”);
String name = (String) connection.getAttribute(server, “Name”);
System.out.println(“Server’s name “+name);

Alternatively you can write a simple WLST script in far less lines to achieve the same, but ofcourse you will need weblogic classes in your classpath. Here’s how your script will look like.
# assuming you know the username, password and url
connect(username, password, url)
svr = cmo.lookupServer(‘myserver’)
print svr.getName()

This is an overview of Management API changes in 9.0. In my BEAWorld session on WLST I am going to briefly discuss these changes. For more information please check out BEA Edocs.

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

WLS 9.0 Management API – part 1

Thursday, September 8th, 2005

WLS 9.0 Management API – part 1
In WLS 5.1 when things were much more simpler, we had a weblogic.properties file that comprised all the configuration information. None of the configuration change was dynamic, i.e if you modified a configuration parameter, to apply the change you had to re-boot the server. WLS also had an applet based console.. :-) .
From 6.0 onwards, WLS built its Management layer on JMX 1.0 and introduced MBeans for programmatic access. The MBeans are broadly branched into 2 types, Configuration and Runtime. Configuration MBeans represented the configuration aspects of the WebLogic Server(example, ServerMBean) and the Runtime MBeans hosted all the runtime information pertaining to the Server (example, JVMRuntimeMBean). All of the configuration is stored in config.xml, which is not schema based and most of the configuration is hierarchical. WLS also started supporting dynamic change (atleast for some configuration parameters). If you made a change to the configuration, the change was applied instantaneously and the configuration file (config.xml) was updated (depending on the save domain trigger). There was only one MBeanServer that hosted all MBeans including the Configuration, Runtime and any Custom MBeans. Since in JMX 1.0 there is no remotable API to get to the MBeanServer from a client, WLS implemented MBeanHome and RemoteMBeanServer. Clients could lookup MBeanHome in JNDI and get access to RemoteMBeanServer and invoke on the MBeans.
Here’s what you would do to get to the ServerMBean.
……
Context ctx = null;
MBeanHome mbeanHome = null;
// assuming you know the user, password and url
try {
Environment env = new Environment();
env.setProviderUrl(url);
env.setSecurityPrincipal(user);
env.setSecurityCredentials(password);
ctx = env.getInitialContext();
mbeanHome = ( MBeanHome ) ctx.lookup(MBeanHome.LOCAL_JNDI_NAME);
ServerMBean svrBean = (ServerMBean) mbeanHome.getMBean(“myserver”,”Server”);
System.out.println(“ServerMBean retrieved “+svrBean.getName());
} catch (Exception e ) {
// handle exception
}

WLS also provided typed stubs on MBean interfaces, saving clients from writing straight JMX code. WLS introduced the WebApp based console and a command-line tool (weblogic.Admin) to manage the domain.
Well, thats the brief overview of what we had prior to WLS 9.0 Management. In my next entry we will discuss the new 9.0 management API.

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

BEAWorld session on WLST

Tuesday, September 6th, 2005

BEAWorld session on WLST
We all know that BEAWorld 2005, Santa Clara is right around the corner (the last week of September). There are many interesting sessions this year, but unfortunately there isn’t a session that talk’s about the new WLS 9.0 Management Framework/API that we(i.e the WLS OAM Team) worked on for the past 2 years. Since I am a member of WLS OAM Team and doing a session on WLST this year, I thought I would take this oppurtunity to introduce the new Management API on which WLST is built on. In my coming blogs I will talk about the new WLS 9.0 Management API.

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