I would like to use JConsole to monitor my Websphere application, but I am not sure how to enable JMX.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
You can find the correct port to connect to on the WebSphere Application Server under Communications -> Ports. The port associated with BOOTSTRAP_ADDRESS allows you to connect.
from http://malliktalksjava.in/2010/07/26/enable-jmx-remote-port-in-websphere/
Login to Admin console of the web sphere any profile(server), short cut will be available in start menu programs.
Enable the PMI Data and set all the statistics enabled.
Set JVM argument
in shows the servers list. click on the server you want.
-Djavax.management.builder.initial= -Dcom.sun.management.jmxremote
in Generic Jvm Argument field and save changes.To enable the JMX remote port open the following properties file and add the code that follows. In [WebSphere-directory]\AppServer\java\jre\lib\management\management.properties, add:
Save the master data, stop the server, and start the server to load the changes.
I couldn't get this to work. All I got was
I did however get it working by doing the following:
But none of the usefull mbeans show up..?
Following information is for Websphere 6.1 on Windows.
First of all, the magic URL to connect to the MBean server is:
If you have a default Websphere installation, the JNDI port number will likely be 2809, 2810, ... depending on how many servers there are installed on one system and the specific one you want to connect to. To be sure, when starting Websphere, check the logs, as it will dump a line like
If you don't get this line, open the Websphere admin console and go to
to see if you need to add or change the config.
Second important bit of information is that the following JAR is always needed when doing JMX with the server:
You can find this JAR in the the
runtimes
directory of Websphere. Whatever you do, whether programmatically accessing MBeans on Websphere, or using JConsole, and so on, use the magic URL and always include this JAR.For the remainder of this answer, assume that Websphere is installed in D:\prog\was61.
To run JConsole, type in the following:
Then go to the "Advanced" tab and type in the magic JMX URL. Press connect and you should see the MBeans appear.
Using a Sun JDK is an entirely different matter. You need one extra JAR that is in the lib of the IBM JDK but not Sun's (ibmorb.jar), and maybe the following command may work for you:
I say maybe, because it didn't work for me. I got a nice jndiUnavailCommErr error message, since it expected something on port 2809 while my Websphere installation is listening on 2810, although I correctly specified port 2810 in the JMX URL. But, if you adapt the paths to point to your Sun JDK, it might work for you. It's the closest I ever got to connecting to Websphere using Sun's JDK.
Final note: I tried a solution based on RMI, there is also a SOAP connector available but haven't tried it.
As always with J2EE, Websphere and stuff: good luck, you'll need it.
It is simple. Just start Websphere with the following JMX parameters:
Then start JConsole or VisualVM and connect to localhost:1099
Since i am not allowed to post a proof screenshot i post the information from the visualvm "overview tab".
I found that in order to connect to WAS 6.1 using the Sun JDK JConsole, in addition to the
com.ibm.ws.admin.client_6.1.0.jar
JAR file, I had to also include the following 3 JARs on the boot class path when starting JConsole:-These can be found in the java\jre\lib directory of websphere.
For example on windows, if you copy all the four JARs listed above to a directory of your choice (i've copied them to C:\packages\was61-jmx in the example below), you can use a batch file like the following to start JConsole:-
This worked for me for jdk 1.5 and 1.6 versions of the Sun Jconsole.