Imagos Consulting Weblog

Developers Cant Do Design (or Can They?) – Neville Richards Personal Blog

Site Performance Testing (Part 2) – Weblogic

on September 11, 2012

Jvisualvm is a great tool for looking at various aspects of Java application performance. When you are running your application on an application server such as Weblogic it can be more difficult to use. The steps below allow you to attach Jvisualvm to a remote instance of Weblogic

You either need to run jstatd on the remote side, or specify a JMX connection using host:port.

Jstatd:

jstatd -J-Djava.security.policy=permissions.txt [-p port]

After that: add a remote connection to the target machine, and on the properties of that remote connection configure the jstatd connection.

(permissions.txt contains for example this:

grant {
  permission java.security.AllPermission;
};
  1. ssh -D 9696 me@remote, and run jstatd as above on the remote command line. If you want jstatd to be on a different port than the default 1099, use the -p argument to jstatd.
  2. run visualvm.exe -J-Dnetbeans.system_socks_proxy=localhost:9696 -J-Djava.net.useSystemProxies=true on the local machine

in visual vm: add new remote connection, and specify remote as host and the port for jstatd (1099 for default, or what you specified with -p when running jstatd)

You should now see the processes on the remote side in visualvm

To connect JMX to weblogic

Add the following JVM parameters to your Weblogic startup scripts:

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8888 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

and restart the server. You’ll be able to connect remotely via JConsole/VisualVM/etc at host:8888 then

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: