WebSphere JVM MXBeans - jvm

When using Oracle JVM, we can obtain a large amount of useful JVM data using the provided MXBeans like GarbageCollectorMXBean, MemoryMXBean etc. Are the same MXBeans available in case of a WebSphere JVM ?
Thanks in advance.

Yes, they are available also on WebSphere, but it is somewhat tricky to access them remotely. I just completed a documentation that explains what you need to know to access these MXBeans:
http://code.google.com/p/xm4was/wiki/WebSphereJmx
The XM4WAS project also provides some tools to make that easier. The following document describes how to use them to set up VisualVM to monitor a WebSphere JVM:
http://code.google.com/p/xm4was/wiki/VisualVMHowTo

Yes, if it is java 1.5+.
WAS also has PMI you should look into.

Related

How to monitor JVM usages for Websphere Applications?

I'm trying to monitor JVM usages in IBM Websphere Server. Normally I use jstat tool from the JDK but since that's not available with IBM WAS, is there any other tool available for the same?
WAS uses IBM's J9 JVM under the hood. So, some of the HotSpot JVM's debugging tool will not work with it. WAS exposes all details using Performance Monitoring Infrastucture(PMI). You should be able to get lots of metrics using it. You need to enable this feature in order to get metrics.

How to monitor JVM without installing JDK

I want to monitor JVM performance on my production environment. I have installed only JRE, not JDK, Hence i can't use jstat, jconsole etc. to monitor the JVM performance.
Can somebody please help to understand how can i monitor JVM performance in this scenario?
Is there any way to achieve this?
(please note that i don't want to monitor it remotely through JMX or something else. i would like to install local agent in each machine which will send the metrics to server at the interval of 1 minute.)
Thanks,
KS
If you manage to get JMX up and running on your VM (from the comment), you can then use jmxterm or jmxfetch to push these JMX metrics into a metrics system (like graphite or Datadog).
If you have enough patience and time to write, you can probably have a look at JVMTI. You can write your code in C/C++ and run it along your Java Process and you can gather information about the JVM without affecting it.
Another simple and naive way is to start your VM with a javaagent written in java but JVMTI is even better than that. The most crucial difference between the javaagent and JVMTI app is derived from the loading mechanics. While the agents are loaded inside the heap, they are governed by the same JVM. Whereas the JVMTI agents are not governed by the JVM rules and are thus not affected by the JVM internals such as the GC or runtime error handling.
You can even give Java Mission Control a try if you're using JDK7 or above :)
Jolokia is a java agent you can use to expose JMX as http. Run jmx2graphite and get those metrics into Graphite. The link includes instructions on Graphite installation (10 minutes)

Worklight + WebSphere eXtreme Scale

I tried the integration of these products based on this article and I hit the same problem already documented in the article.
"invocation of javascript function 'getRSSFeeds' has failed: Could not initialize class com.ibm.websphere.objectgrid.ObjectGridManagerFactory
FWLSE0101E: Caused by: [project ExtremeScaleInWorklight]java.lang.NoClassDefFoundError: Could not initialize class com.ibm.websphere.objectgrid.ObjectGridManagerFactory"
It seems that it is caused by a Java class collision of log4j.
My solution was to create a separate Liberty server and install the WXS client for Liberty. This solved the problem, but then I cannot use the WL Development Server anymore which turns the development less efficient.
What is the best way to develop this kind of solution?
I have seen this integration of products on several slides, but I can't find an official guide on how to achieve this. Is there any?
Have You tries to get the IBM WebSphere eXtremeSCale Liberty profile developer tools 8.6 also installed in your WL Development Server ?
SO WXS has two components Client ( libraries) and Serer side components. They can be housed in the same JVM -- for tests, in production this does not really make sense. Serer side hosts storing of objects and enforcing the 'grid management' policies that you may employ using the xml confg files.
perhaps you can use IBM WebSphere eXtremeSCale Liberty profile developer tools 8.6 also installed in your WL Development Server and include then in the classpath.

What is the purpose of WebLogic JarBuilder Tool?

I came across WebLogic JarBuilder Tool and this link has information on how to use it. But I am not able to find anywhere on what is the purpose of this tool and when we have to use this. Can someone please help me in understanding the use of this tool and if possible can it be explained with some examples.
From http://docs.oracle.com/cd/E15051_01/wls/docs103/client/basics.html#wp1069994:
Prior to WebLogic Server 10.0, the weblogic.jar file was required for
T3 and WLS-IIOP client applications to provide WebLogic
Server-specific value-added features. For WebLogic Server 10.x and
later releases, client applications requiring these features should
use the wlfullclient.jar file instead of the weblogic.jar. See Client
Types and Features for more information on client types, features, and
class requirements.
You can generate the wlfullclient.jar file for client applications
using the JarBuilder tool. See Using the WebLogic JarBuilder Tool.

Obtain useful data from WebSphere JVM

I would like to attach to a WebSphere JVM and obtain useful data like garbage collectors' names and their collection counts, thread counts, heap/non-heap memory usage, JVM uptime etc. However, this link gives the list of MBeans available with the WebSphere JVM -
http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=%2Fcom.ibm.websphere.javadoc.wsfep.doc%2Fweb%2FmbeanDocs%2Findex.html
These MBeans don't seem to offer any data that I require. Is there any other way to obtain the data? I shall be using JMX to gather it.
If you're a corporate with bucks to spend I would suggest a product like Wily Introscope which runs an agent along with your JVM to collect all the metrics that you are after. I have used it with Websphere servers. Searching for an Open Source alternative I came across GlassBox which may provide a low cost alternative for you.
I'm not aware of any default MBeans that will provide the coverage you're after. It's typically the big Java vendors that provide this type of functionality.
[Update]
Having done something recently using VisualVM with Websphere 7, for the purposes of real-time monitoring/troubleshooting, I thought I would share my knowledge. VisualVM comes with the standard Sun JDK and you will find it installed here: JAVA_HOME\bin\jvisualvm.exe
To enable the JRE in Websphere to allow VisualVM to connect you must add the following JVM parameters using the Websphere Admin Console
Go To: Application Servers > [server_name] > Java and Process Management > Process definition > Java Virtual Machine > Generic JVM arguments
-Djavax.management.builder.initial=
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.local.only=false
Make sure that the port number you have chosen above is not already in use
netstat -ap | grep 1099
Restart the server and you will be able to connect using VisualVM to see Uptime, Threads, Heap and GC profiles.
I see that Sun have also documented how you can write your own Java JMX client to read these values.
You could go with the suggestions provided by Brad and Andreas.
I would like to give you some insights into some of the tools that should be explored
(1) Tivoli Performance Viewer. This should provide some information about the JVM.
(2) IBM Health Center -> http://www.ibm.com/developerworks/java/jdk/tools/healthcenter/
Both of these should provide you a lot of info that you require.
Try them out
The JVM statistics are provided by the platform MXBeans. If you need to collect this data over a short period of time, then you could use a tool such as VisualVM. It's a bit tricky to configure this to connect to a WebSphere instance, but it is possible. One way to do that (there are other options) is described here:
http://code.google.com/p/xm4was/wiki/VisualVMHowTo
If you want to collect the data over a longer period of time, then you need a monitoring system. At work, I wrote a plugin for the Open Source RHQ enterprise management system that adds support for WebSphere. I'm in the process of releasing this plugin as an Open Source project, but at the time of writing, I have not yet published the documentation and there is also no downloadable release yet. Only the source code is available right now. I will try to complete that in the next weeks. If you are interested in this project, please let me know.