X

Proactive insights, news and tips from Oracle WebLogic Server Support. Learn Oracle from Oracle.

  • October 5, 2009

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.




Join the discussion

Comments ( 39 )
  • jlamande Monday, November 9, 2009
    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/
  • philippe Le Mouel Monday, November 9, 2009
    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
  • buy warcraft gold Monday, August 2, 2010
    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.
  • Mr Big Tuesday, October 5, 2010
    Very informative, thanks for clearing up some issues for me! :)
  • Wolfgang Grinfeld Friday, October 29, 2010
    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

  • hostessy krak&oacute;w Thursday, November 4, 2010
    It's everything here exactly...what I was looking for :) I'm so happy that I step in right here.
  • salt mine krakow Monday, November 8, 2010
    Bah! My friend its everything exactly what I was looking for :) I'm so happy that I step in right here.
  • Abeo Saturday, November 13, 2010
    You forgot to add the income tax on the 250k interest!
  • noclegi w krakowie Friday, November 26, 2010
    It's everything here exactly what I was looking for :) I'm so happy that I step in right here.
  • Quyen Siddiqi Monday, November 29, 2010
    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.
  • Orcl Monday, November 29, 2010
    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?
  • BeanSoft Tuesday, November 30, 2010
    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
  • Marlin Unsell Saturday, January 8, 2011
    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.
  • fghfhghh Thursday, January 13, 2011
    Just like commenting for the sake of it. It makes whoever posted the article feel that somebody cares. and we do!
  • Valeri Krimple Thursday, January 13, 2011
    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.
  • livre de poche Thursday, January 27, 2011
    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.
  • guest Thursday, February 3, 2011
    im getting the following error can you help me please? org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 208 completed: Maybe
  • posicionamiento web Thursday, February 3, 2011
    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
  • Jerica Bellanca Friday, February 4, 2011
    This is the blog I was looking for! Thanks
  • rk Wednesday, February 9, 2011
    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
  • Get Backlinks Thursday, February 17, 2011
    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.
  • Clomid Saturday, February 26, 2011
    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.
  • Buy Backlinks Wednesday, March 2, 2011
    I love the way you write and also the theme on your blog. Did you code this yourself? I'm very very impressed.
  • bags Thursday, March 3, 2011
    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.
  • Keflex Saturday, March 5, 2011
    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.
  • Paxil buy online Sunday, March 6, 2011
    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?
  • Tegretol generic Monday, March 7, 2011
    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.
  • no fee loans Sunday, March 13, 2011
    *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.
  • Sasa Milicevic Friday, March 18, 2011
    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?
  • Diflucan Wednesday, March 23, 2011
    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.
  • Srikanth Thursday, April 14, 2011
    I am getting the same error as Sasa Milicevic. Can you please help with this....
    Thanks,
    Srikanth
  • Srikanth Thursday, April 14, 2011
    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
  • Comforters Thursday, April 14, 2011
    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.
  • JA Henckels Knife Sharpeners Friday, April 15, 2011
    I hate when fathers don't disipline their offspring in clear places.
  • Malcolm Hoye Monday, April 18, 2011
    This was novel. I wish I could read every post, but i have to go back to work now... But I'll return.
  • Sharron Dunzelman Tuesday, April 19, 2011
    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?
  • Presto Knife Sharpeners Friday, April 22, 2011
    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.
  • guest Friday, September 6, 2013

    I am trying to manage logback settings via JConsole on weblogic. If the server is on the same machine I have no issues, but when it comes to connect remotelly via RMI I can only browse the MBeans (I see the logback tree and attributes), but I can't actually perform any operations due to the following error:

    java.rmi.UnmarshalException: Error unmarshaling return; nested exception is: java.lang.ClassNotFoundException: weblogic.management.NoAccessRuntimeException > (no security manager: RMI class loader disabled)

    I've been trying for a while with no much luck, here's what I am currently using to lunch JConsole:

    /opt/oracle-soa/jdk160_29/bin/jconsole -J-Djava.class.path=$JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/lib/tools.jar:$WL_HOME/server/lib/*:$LIB/*:$LIB/slf4j-1.7.5/* -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.mbeanservers.runtime -J-Djava.security.policy=/opt/oracle-soa/jdk160_29/jre/lib/security/java.policy -debug hercules:7099

    Here's how I start weblogic

    JAVA_OPTIONS="${JAVA_OPTIONS} -Xmanagement:ssl=false,authenticate=false,port=7099 -Djavax.management.builder.initial=weblogic.management.jmx.mbeanserver.WLSMBeanServerBuilder" export JAVA_OPTIONS

    I think the issue is not with Logback, but with Weblogic as even for other operation on MBeans server don't work. Probably some libraries missing or "feature" to enable?

    Any help is welcome. Thanks in advance


  • guest Saturday, February 21, 2015

    Hi ,

    I am having below exception when try to forceShutdown server via jconsole:

    problem invoking forceShutdown:java.rmi.UnmarshallException:Error unmarshalling return;nested exception is:java.lang.ClassNotFoundException:weblogic.management.NoAccessRuntimeException(no security manager:RMI class loader disabled).

    Kindly help,,


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.