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:
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.
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.
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;
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).
Configuring JavaVM parameter for application server
Starting the JConsole remote
MBean tab of JConsole with ClasspathMonitor