Menu

Enabling ClasspathMonitor in Websphere

JavaVM (1)
Oliver Boehm

If you want to access the ClasspathMonitor of PatternTesting as described e.g. in Hello World and you are using Websphere you have two problems:

  1. Websphere
  2. IBM-JDK

Let us begin with point 2. While the ClasspathMonitor of PatternTesting runs out of the box with the SUN-JDK, you must activate the PatternTesting-Agent for IBM’s JDK as described in the PatternTesting Agent's Documentation:

java -javaagent:patterntesting-agent-1.4.3.jar …

If you want to add this VM argument for your application open your Websphere Console, select your configured server in the "Servers > Server Types > WebSphere application servers" menu (normally it is called "server1"). For this server go to "Process definition > Java Virtual Machine" - you should now see a mask as in the attached image WasWithJavaagent.png:
.
Add the option "-javaagent:patterntesting-agent-1.4.3.jar" to the Generic JVM arguments and restart the server.

JConsole Connected to WAS

It is not so easy to connect your jconsole to your application running inside Websphere. You can do it by adding the following parameters to the Generic JVM arguments (see again the screenshot WasWithJavaagent.png above:

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=flase
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=1099

Warning: these are only settings for development systems. In production you should not disable authentication and SSL.

JConsole

To connect JConsole to your application add localhost:1099 as value for the remote process. It may be that you'll get with "ConnectionFailedSSL1" or/and "ConnectionFailedSSL2" - ignore it and select the insecure button. You should now see in the MBeans tab of the JConsole your application and also the MBeans of PatternTesting (
see ClasspathMonitor MBean) if you have registered it programmatically:

ClasspathMonitor.registerAsMBean;

ClasspathMonitorMBean

Now you can examine the classpath or call some operation to get some more information for single class (see ClasspathMonitorMBean for a description of the operations).


Related

Wiki: MainPage

Discussion

  • Oliver Boehm

    Oliver Boehm - 2014-12-14

    Configuring JavaVM parameter for application server

     
  • Oliver Boehm

    Oliver Boehm - 2014-12-18

    Starting the JConsole remote

     
  • Oliver Boehm

    Oliver Boehm - 2014-12-18

    MBean tab of JConsole with ClasspathMonitor

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.