Welcome!

Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

JMX Debugging

Third-party tools make access easy

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
  • More Stories By 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.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    IoT & Smart Cities Stories
    The best way to leverage your Cloud Expo presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering Cloud Expo and @ThingsExpo will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at Cloud Expo. Product announcements during our show provide your company with the most reach through our targeted audiences.
    Machine learning has taken residence at our cities' cores and now we can finally have "smart cities." Cities are a collection of buildings made to provide the structure and safety necessary for people to function, create and survive. Buildings are a pool of ever-changing performance data from large automated systems such as heating and cooling to the people that live and work within them. Through machine learning, buildings can optimize performance, reduce costs, and improve occupant comfort by ...
    @DevOpsSummit at Cloud Expo, taking place November 12-13 in New York City, NY, is co-located with 22nd international CloudEXPO | first international DXWorldEXPO and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time t...
    CloudEXPO New York 2018, colocated with DXWorldEXPO New York 2018 will be held November 11-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI, Machine Learning and WebRTC to one location.
    DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
    Disruption, Innovation, Artificial Intelligence and Machine Learning, Leadership and Management hear these words all day every day... lofty goals but how do we make it real? Add to that, that simply put, people don't like change. But what if we could implement and utilize these enterprise tools in a fast and "Non-Disruptive" way, enabling us to glean insights about our business, identify and reduce exposure, risk and liability, and secure business continuity?
    In this Women in Technology Power Panel at 15th Cloud Expo, moderated by Anne Plese, Senior Consultant, Cloud Product Marketing at Verizon Enterprise, Esmeralda Swartz, CMO at MetraTech; Evelyn de Souza, Data Privacy and Compliance Strategy Leader at Cisco Systems; Seema Jethani, Director of Product Management at Basho Technologies; Victoria Livschitz, CEO of Qubell Inc.; Anne Hungate, Senior Director of Software Quality at DIRECTV, discussed what path they took to find their spot within the tec...
    The deluge of IoT sensor data collected from connected devices and the powerful AI required to make that data actionable are giving rise to a hybrid ecosystem in which cloud, on-prem and edge processes become interweaved. Attendees will learn how emerging composable infrastructure solutions deliver the adaptive architecture needed to manage this new data reality. Machine learning algorithms can better anticipate data storms and automate resources to support surges, including fully scalable GPU-c...
    Nicolas Fierro is CEO of MIMIR Blockchain Solutions. He is a programmer, technologist, and operations dev who has worked with Ethereum and blockchain since 2014. His knowledge in blockchain dates to when he performed dev ops services to the Ethereum Foundation as one the privileged few developers to work with the original core team in Switzerland.
    DXWorldEXPO LLC announced today that Telecom Reseller has been named "Media Sponsor" of CloudEXPO | DXWorldEXPO 2018 New York, which will take place on November 11-13, 2018 in New York City, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.