Managing WebLogic servers with JConsole

In my previous blog I described how to implement a custom WebLogic JMX client. Another way to interact with WebLogic's MBeans, is to use a generic JMX client such as JConsole. JConsole is shipped as part of the JDK, and doesn't require any specific download or installation. This blog demonstrates how simple it is to browse WebLogic MBeans using JConsole.




In order to connect to a WebLogic MBeanServer, JConsole needs to be started as follow:




jconsole -J-Djava.class.path=$JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/lib/tools.jar:
$WL_HOME/server/lib/wljmxclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote -debug


WL_HOME points to the WebLogic binary install.


The above uses WebLogic's thin client classes. In some cases when you access server side classes, or you want to take full advantage of the t3 protocol, you are required to use WebLogic's thick client classes. To do so, you first need to build wlfullclient.jar as follow:




cd $WL_HOME/server/lib


java -jar wljarbuilder.jar


You can then start JConsole as follow:




jconsole -J-Djava.class.path=$JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/lib/tools.jar:
$WL_HOME/server/lib/wlfulclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote -debug


wlfulclient.jar is not dependent on external jars, and can be copied to client machines. When using the thin client ( wljmxclient.jar ) you cannot just copy wljmxclient.jar to a client's machine as this jar references other jars as part of its manifest Class-Path entry. At the time of this writing, you also need to copy wlclient.jar



-J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote identifies the package implementing WebLogic's client side connectors code. For instance the 't3' or 'iiop' client connectors.



Finally the -debug flag is extremely handy when a connection failure occurs. In this case the corresponding stack trace is dumped on the console.




Once JConsole is started select the Remote process connection, and fill out the target WebLogic's MBeanServer JMX URI, Username and Password fields. See figure below:



JConsole not yet connected to WebLogic's Runtime MBeanServer

The JMX service URI:


service:jmx:iiop://140.87.10.42:12565/jndi/weblogic.management.mbeanservers.runtime


identifies the following:



  • The protocol used to communicate with the remote WebLogic process. "iiop" in the above example. WebLogic supports "t3", "iiop" and "rmi". We won't touch further on this topic here.

  • The WebLogic process to connect to (host & port ). 140.87.10.42:12565 in the above example.


    The port value is available from the <WLS_INSTANCE_HOME>/config/config.xml file:


    <server>
    <name>myServer</name>
    <listen-port>12565</listen-port>
    <listen-address>140.87.10.42</listen-address>
    </server>

    Make sure you look under the correct server if several servers are defined as part of your config.xml. For instance in the above case we are connecting to the server identified as "myServer".



  • The MBeanServer to connect to: weblogic.management.mbeanservers.runtime. This identifies WebLogic's "Runtime" MBeanServer. This is the MBeanServer available from any WebLogic process, and that contains both WebLogic and user MBeans. WebLogic also offers two other MBeanServers that are only available from the Domain "AdminServer" process:

    • The "Domain Runtime" MBeanServer. It aggregates the MBeans registered on the domain's "Runtime" MBeanServers. So as long as a managed server is up, its MBeans can be accessed through the "Domain Runtime" MBeanServer. To connect to that MBeanServer, just use the following JMX URI:



      service:jmx:iiop://140.87.10.42:7002/jndi/weblogic.management.mbeanservers.domainruntime

      "7002" is the iiop port for my "AdminServer" install. Replace with your AdminServer's port as previously explained. Remember; only the AdminServer process runs the "Domain Runtime" MBeanServer.



    • The "Edit" MBeanServer. It contains the WebLogic Config MBeans that are used to configure the Domain. To connect to that MBeanServer, just use the following JMX URI:



      service:jmx:iiop://140.87.10.42:12565:7002/jndi/weblogic.management.mbeanservers.edit

      "7002" is the iiop port for my "AdminServer" install. Replace with your AdminServer's port as previously explained. Remember; only the AdminServer process runs the "Domain Runtime" MBeanServer.





    Note: One can also use "t3" or "rmi" as protocol in place of "iiop"





Finally provide the login and password values for the user associated with the connection. The WebLogic admin user is often used, but other users can be used as well. Depending on the authenticated user and his/her associated roles, operations on MBeans will be granted or denied. We won't dive further in this topic here. Click connect and voila!



JConsole connected to WebLogic's Runtime MBeanServer


If JConsole fails to connect, look at the stack trace dumped on the console. Make sure you specified the -debug flag when starting JConsole, or you will not see any meaningful information on the console. Common cause of connection failures include: wrong host/port; wrong login/password; jmx.remote.protocol.provider.pkgs not properly specified and incorrect ClassPath. Also note that the above instructions apply to WebLogic server 10.3.1 and above.




JConsole's MBean tree preserves the key order used when building MBeans ObjectNames. The only exception is for the 'type' property which will be included first if present and the 'j2eeType' property which will be included second if present. In general I also use the 'name' property to identify different MBean instances while WebLogic MBeans use 'Type' and 'Name' properties for the same purpose. To ensure that JConsole's MBean tree is build with 'type' or 'Type' as first node and 'name' or 'Name' as its child I use the following command line:




jconsole -J-Djava.class.path=$JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/lib/tools.jar:
$WL_HOME/server/lib/wljmxclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote -J-Dcom.sun.tools.jconsole.mbeans.keyPropertyList=type,Type,j2eeType,name,Name -debug



When connecting to WebLogic's "Domain Runtime" MBeanServer, one can also order by MBean 'Location' as follow:




jconsole -J-Djava.class.path=$JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/lib/tools.jar:
$WL_HOME/server/lib/wljmxclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote -J-Dcom.sun.tools.jconsole.mbeans.keyPropertyList=Location,type,Type,j2eeType,name,Name -debug




Aside from browsing and editing MBeans, JConsole can be used to monitor WebLogic processes resource usage: Memory, Threads, Class loading. Consult JConsole's documentation for more information.




Comments:

Hi, My environment is Weblogic Server / Portal 10gR3. when using the command line to launch JConsole, after I entered the JMX URL with pwd and login, I get the following error (-debug flag) : java.lang.SecurityException: Anonymous attempt to get to a JNDI resource .... .... This problem has already been referenced as a bug in previous Weblogic versions of JMX connectors (not providing the credentials). Did someone run into the same problem on a 10.3 version ? The main way to pass through this problem is to develop a ClientProvider to correctly provide the credentials during Connection. => (french article) : http://blog.xebia.fr/2007/06/28/jconsole-et-weblogic-9/

Posted by jlamande on November 08, 2009 at 05:23 PM PST #

In previous releases one needed to set the default IIOP User. See link below: http://download.oracle.com/docs/cd/E15051_01/wls/docs103/ConsoleHelp/taskhelp/channels/EnableAndConfigureIIOP.html The credentials passed to JConsole were ignored, and the default IIOP user was the user associated with the connection. This is now fixed in 10.3. Philippe

Posted by philippe Le Mouel on November 09, 2009 at 01:28 AM PST #

I was very pleased to find this site.I wanted to thank you for this great read I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.

Posted by buy warcraft gold on August 02, 2010 at 11:45 AM PDT #

Very informative, thanks for clearing up some issues for me! :)

Posted by Mr Big on October 05, 2010 at 09:18 AM PDT #

For me, the following steps were required:

- build wlfullclient.jar as follow: cd %BEA_HOME%/server/lib java -jar wljarbuilder.jar jconsole -J-Djava.class.path=%JAVA_HOME%/lib/jconsole.jar;%JAVA_HOME%/lib/tools.jar;%bea_HOME%/server/lib/wljmxclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote -J-Dcom.sun.tools.jconsole.mbeans.keyPropertyList=type,Type,j2eeType,name,Name -debug
url = service:jmx:rmi:///jndi/iiop://127.0.0.1:7058/weblogic.management.mbeanservers.domainruntime adminuser and password were also required

Posted by Wolfgang Grinfeld on October 28, 2010 at 05:44 PM PDT #

It's everything here exactly...what I was looking for :) I'm so happy that I step in right here.

Posted by hostessy kraków on November 04, 2010 at 11:27 AM PDT #

Bah! My friend its everything exactly what I was looking for :) I'm so happy that I step in right here.

Posted by salt mine krakow on November 08, 2010 at 08:29 AM PST #

You forgot to add the income tax on the 250k interest!

Posted by Abeo on November 13, 2010 at 06:08 AM PST #

It's everything here exactly what I was looking for :) I'm so happy that I step in right here.

Posted by noclegi w krakowie on November 25, 2010 at 07:30 PM PST #

The ad appeals to Congress to complete something urgently. On december 17th : White layer Wednesday : physicians during the entire USA shall be calling in the members about Congress, reminding these individuals that just what they undertake or tend not to do are going to have serious together with long- geting to consequences just for American golden-agers who depend on Medicare.

Posted by Quyen Siddiqi on November 29, 2010 at 04:49 AM PST #

When I write the command line: C:/Oracle/Middleware5/wlserver_10.0/server/lib/wljmxclient.jar -J-Djmx.remote.pr otocol.provider.pkgs=weblogic.management.remote -debug Im getting this error... Exception in thread "main" java.lang.NoClassDefFoundError: sun/tools/jconsole/JC onsole Who can help me please?

Posted by Orcl on November 29, 2010 at 05:16 AM PST #

Hi Orcl, the command on linux is is: jconsole -J-Djava.class.path=$JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/lib/tools.jar:$WL_HOME/server/lib/wljmxclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote -debug on windows it should be: jconsole -J-Djava.class.path=$JAVA_HOME/lib/jconsole.jar;$JAVA_HOME/lib/tools.jar;$WL_HOME/server/lib/wljmxclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote -debug

Posted by BeanSoft on November 30, 2010 at 11:13 AM PST #

I’m not sure where you are getting your info, but great topic. I needs to spend some time learning much more or understanding more. Thanks for excellent information I was looking for this info for my mission.

Posted by Marlin Unsell on January 08, 2011 at 05:04 AM PST #

Just like commenting for the sake of it. It makes whoever posted the article feel that somebody cares. and we do!

Posted by fghfhghh on January 12, 2011 at 06:09 PM PST #

Honey! Poor Honey! Your Hsin Yi is torturing you. No wonder youre so exhausted. Look at all that hard work you had to do for a few nibbles of treats. Yes, I would have ripped that puzzle bone apart. YOu had the right idea! Dont humans know by now that domestic dogs get fed in bowls, like civilized canines? ggeeesh.

Posted by Valeri Krimple on January 13, 2011 at 02:00 AM PST #

I would like to point out my passion for your kindness giving support to women who really need help on this particular subject matter. Your very own dedication to passing the solution all through was pretty powerful and have all the time made most people just like me to realize their objectives. Your amazing helpful instruction entails a lot a person like me and extremely more to my peers. Thanks a lot; from all of us.

Posted by livre de poche on January 27, 2011 at 11:06 AM PST #

im getting the following error can you help me please? org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 208 completed: Maybe

Posted by guest on February 02, 2011 at 09:59 PM PST #

Unquestionably believe that which you stated. Your favorite reason seemed to be on the web the easiest thing to be aware of. I say to you, I certainly get irked while people think about worries that they just don't know about. You managed to hit the nail upon the top as well as defined out the whole thing without having side effect , people can take a signal. Will likely be back to get more. Thanks

Posted by posicionamiento web on February 03, 2011 at 06:36 AM PST #

This is the blog I was looking for! Thanks

Posted by Jerica Bellanca on February 03, 2011 at 05:32 PM PST #

We have a custom JMX cleint when deployed with the following timeout code generates a securityexception. Code without timeout does not throw any exception. Any ideas? Code: h.put("jmx.remote.x.request.waiting.timeout", new Long(20000)) Exception: ExecuteThread: '21' for queue: 'weblogic.kernel.Default') {java.lang.SecurityException: [Security:090398]Invalid Subject: principals=[system, Administrators]} java.sql.SQLException: java.lang.SecurityException: [Security:090398]Invalid Subject: principals=[system, Administrators] Thanks in advance, rk

Posted by rk on February 09, 2011 at 06:00 AM PST #

This is the best blog I've ever seen in my life! I really appreciate you taking the time out of your day to share this with everyone.

Posted by Get Backlinks on February 17, 2011 at 01:57 AM PST #

Apple now has Rhapsody as an app, which is a great start, but it is currently hampered by the inability to store locally on your iPod, and has a dismal 64kbps bit rate. If this changes, then it will somewhat negate this advantage for the Zune, but the 10 songs per month will still be a big plus in Zune Pass' favor.

Posted by Clomid on February 26, 2011 at 08:53 AM PST #

I love the way you write and also the theme on your blog. Did you code this yourself? I'm very very impressed.

Posted by Buy Backlinks on March 02, 2011 at 01:47 PM PST #

Wonderful blog! I found it while searching on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I are been trying for a while but I never seem to get there! Thank you.

Posted by bags on March 03, 2011 at 05:12 AM PST #

Apple now has Rhapsody as an app, which is a great start, but it is currently hampered by the inability to store locally on your iPod, and has a dismal 64kbps bit rate. If this changes, then it will somewhat negate this advantage for the Zune, but the 10 songs per month will still be a big plus in Zune Pass' favor.

Posted by Keflex on March 05, 2011 at 05:54 AM PST #

I was wondering if you ever considered changing the layout of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or two images. Maybe you could space it out better?

Posted by Paxil buy online on March 06, 2011 at 07:45 AM PST #

I feel like you could probably teach a class on how to make a great blog. This is fantastic! I have to say, what really got me was your design. You certainly know how to make your blog more than just a rant about an issue. Youve made it possible for people to connect. Good for you, because not that many people know what theyre doing.

Posted by Tegretol generic on March 06, 2011 at 10:33 PM PST #

*I’m impressed, I must say. Really rarely do I encounter a blog that’s both educative and entertaining, and let me tell you, you have hit the nail on the head. Your idea is outstanding; the issue is something that not enough people are speaking intelligently about. I am very happy that I stumbled across this in my search for something relating to this.

Posted by no fee loans on March 13, 2011 at 08:06 AM PDT #

I am getting the following error: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338) at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248) at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:350) at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:296) at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:280) I run jconsole with: jconsole -J-Djava.class.path=%JAVA_HOME%/lib/jconsole.jar;%JAVA_HOME%/lib/tools.jar:%WL_HOME%/server/lib/wlfulclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote -debug but keep getting the above error. What is the problem here?

Posted by Sasa Milicevic on March 17, 2011 at 06:50 PM PDT #

Thanks for taking the time to talk about this, I feel fervently about this and I take pleasure in learning about this topic. Please, as you gain information, please update this blog with more information. I have found it very useful. There have to be charging stations everywhere.

Posted by Diflucan on March 23, 2011 at 09:08 AM PDT #

I am getting the same error as Sasa Milicevic. Can you please help with this.... Thanks, Srikanth

Posted by Srikanth on April 13, 2011 at 06:32 PM PDT #

I am also getting the error similar to Sasa Milicevic. java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:323) at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248) at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:362) at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:298) at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:280) Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325) at javax.naming.InitialContext.lookup(InitialContext.java:392) at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1871) at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1841) at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257) ... 4 more Please correct or suggest... -Srikanth

Posted by Srikanth on April 13, 2011 at 06:51 PM PDT #

Would we not read this more in the cable news networks if this were common? I almost never hear of this on the cable news networks. Either this post is advanced, or you have overextended your piece.

Posted by Comforters on April 14, 2011 at 03:35 PM PDT #

I hate when fathers don't disipline their offspring in clear places.

Posted by JA Henckels Knife Sharpeners on April 15, 2011 at 12:59 AM PDT #

This was novel. I wish I could read every post, but i have to go back to work now... But I'll return.

Posted by Malcolm Hoye on April 18, 2011 at 12:40 AM PDT #

Strong blog. I acquired ample nice information. I?ve been keeping a watch on this technology for a few time. It?utes attention-grabbing the manner it retains completely different, nevertheless many of the primary components stay an equivalent. have you observed a lot change since Search engines created their own latest purchase within the field?

Posted by Sharron Dunzelman on April 19, 2011 at 03:18 AM PDT #

I feel like the republicans are just to profit motivated to really say anything ever, i think they have them they are just to much of wusses to ever really yell out their idea/s.

Posted by Presto Knife Sharpeners on April 21, 2011 at 09:56 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The official blog for Oracle WebLogic Server fans and followers!

Stay Connected

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
5
6
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today