YOUR FEEDBACK
Adobe Flex 2 - Answering Tough Questions About Enterprise Development
A Correct Person wrote: Denis Roebrt commented on the 21 Aug 2006 "Tough Que...
SOA World Conference
Virtualization Conference
$50 Savings Expire May 23, 2008... – Register Today!

2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts

SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


JMX Debugging
Third-party tools make access easy

Digg This!

BEA WebLogic 8.1 implements the Java Management Extensions (JMX) 1.0. Most WebLogic subsystems (JMS Providers, the JDBC Container, ExecuteQueues, etc.) and their constituents are instrumented as MBeans and contain attributes by which they can be configured, monitored, and managed. An administrative server instance implements an MBeanServer through which its configuration and runtime MBeans and those of its managed servers may be accessed. A managed server instance implements an MBeanServer through which only the configuration and runtime beans that are resident on it may be accessed.

In a debugging scenario in which a running server is misbehaving, both its configuration beans can be examined to diagnose the problem. BEA Weblogic MBeans may be accessed programmatically via the Java API. In addition, WebLogic provides two mechanisms for accessing MBeans without programming: the weblogic.Admin command and the wlconfig ant task. There are, as well, numerous third-party tools that provide convenient access to MBeans. Two, which I will use in what follows, are wlsh, developed by Paco Gomez of BEA, and wlsScripting, developed using JPython by Satya Ghattu, also of BEA.

I have TestDomain configured with one cluster of two managed servers and an additional independent managed server. Connecting to the admin server with wlsh produces the result in Listing 1.

Connecting to ManagedOne produces Listing 2.

Now I can retrieve the ExecuteThreadCurrentIdleCount from the admin server with

wlsh TestDomain:/> idleCount=/ExecuteQueueRuntime/weblogic.kernel.Default/
ExecuteThreadCurrentIdleCount
variable idleCount set to /ExecuteQueueRuntime/weblogic.kernel.Default/
ExecuteThreadCurrentIdleCount (java.lang.String)
wlsh TestDomain:/> get $idleCount
15

It is almost always important in a production scenario for a crashed server to be restarted immediately. Listing 3, using wlsScripting, periodically checks the server’s status and restarts it if necessary. At the same time, it samples critical attributes for debug purposes.

Listing 4 shows the output of running the script against an instance of the examplesServer as a thread becomes stuck.

In a production environment where large amounts of debug are a problem, it is often difficult to track down transient errors. The JMX API can be used to report debug only in certain conditions. Listing 5 installs a counter monitor that is triggered when the OpenSocketsCurrentCount attribute of the ServerRuntime MBeans reaches a certain level. It doesn’t do anything in the NotificationListener.handleNotification method currently, other than note that a notification was received; however, in a real scenario you might launch a thread at this point that would report periodically on the values of attributes associated with critical resources, say the PendingRequestsCurrentCount from the ExecuteQueueRuntimeMBean for the default queue.

This is the output of running the DebugMonitor:


Java debug.DebugMonitor

Active Domain: medrecTwo
Active Servers:
        Name: MedRecServer
        ListenAddress: JWEAVER1/10.62.3.106
        ListenPort: 7001

        Number of servers active in the domain: 1
>>> MyCounter got notification: javax.management.monitor.MonitorNotification
...

Links

  • Starting point for WebLogic JMX documentation: http://edocs.bea.com/wls/docs81/jmx/index.html
  • Progamming examples: http://edocs.bea.com/wls/docs81/jmx/index.html
  • weblogic.Admin command: http://edocs.bea.com/wls/docs81/admin_ref/cli.html#MBean_Management_Command_Reference
  • wlconfig Ant task: http://edocs.bea.com/wls/docs81/admin_ref/ant_tasks.html#1023006
  • wlsh: www.wlshell.net
  • wlsScripting tool: http://dev2dev.bea.com/codelibrary/code/wlst.jsp
  • About Jim Weaver
    Jim Weaver is a backline WebLogic support engineer in Denver. He has been with BEA for more than three years and worked previously as a C++/Java developer for more than ten years.

    BEA WEBLOGIC LATEST STORIES
    3rd International Virtualization Conference & Expo: Themes & Topics
    From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in midtown
    Microsoft To Keynote 4th International Virtualization Conference & Expo
    Mike Neil is general manager for virtualization strategy in the Windows Server Division at Microsoft. Mike is focused on the delivery of the Windows virtualization technology, including Windows Server 2008 Hyper-V, Microsoft Hyper-V Server and Virtual PC 2007. Mike also directs the tec
    Virtualization Meets DaaS - Desktop-as-a-Service
    After a $1.5 million angel round, Desktone, which was started in 2006 by Eric Pulier, who also started SOA Software, US Interactive and IVT, picked up $17 million in first-round funding about a year ago from Highland Capital Partners, SoftBank Capital, Citrix Systems and the China-base
    Engelbart's Usability Dilemma: Efficiency vs Ease-of-Use
    The mouse was the original idea of Doug Engelbart who was the head of the Augmentation Research Center (ARC) at Stanford Research Institute. Engelbart's philosophy is best embodied, in my opinion, in the design of another device that he invented, the five-finger keyboard - with keys li
    Web 2.0 Is Fundamentally About Empowering People
    'Unlocking content to be remixed into new business value' is the driver of Web 2.0 in the enterprise, says Rod Smith, IBM VP of Emerging Internet Technologies, in this Exclusive Q&A with Jeremy Geelan on the occasion of IBM's release of a new technology created by IBM researchers, code
    Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
    Here is a question that I have been pondering on and off for quite a while: Why do 'cool kids' choose Ruby or PHP to build websites instead of Java? I have to admit that I do not have an answer. Why do I even care? Because I am a Java developer. Like many Java developers, I get along w
    SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
    SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
    Click to Add our RSS Feeds to the Service of Your Choice:
    Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
    myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
    Publish Your Article! Please send it to editorial(at)sys-con.com!

    Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

    SYS-CON FEATURED WHITEPAPERS

    MOST READ THIS WEEK
    ADS BY GOOGLE
    BREAKING NEWS FROM THE WIRES
    AmberPoint Extends SOA Governance to Apache ServiceMix, BEA AquaLogic Service Bus 3.0, BEA WebLogic Integration, Cisco ACE XML Gateway, JBoss Enterprise Application Platform and Oracle Fusion
    AmberPoint announced today that it has extended the reach of its runtime SOA governance