Question

When I run a Java application (simple application with a main method) the VisualVM list it as running application. However, after running my Java Web application on NetBeans, VisualVM 1.3.7 just shows NetBeans IDE 7.2.1 (pid 4708), VisualVM and GlassFish (pid 2136) under Local.

In Netbeans configuration, I am using JDK 1.7, the J2EE Version is Java EE6, Profile is set to Web and it is running on GlassFish Server 4.

Also I set the web container to high, based on "Cannot Get The List Of Web Applications From GlassFish" section of this.

Based on my research to solve the problem I downloaded and installed VisualVM-Extensions plugin as well to no avail.

I used all following methods to run VisualVM.

  1) I ran it by executing the VisualVM.exe file
  2) using following command in console 
      visualvm --jdkhome "C:\Program Files\Java\jdk1.7.0_13" --userdir "C:\Users\Alex\AppData"
  3) using following command in console
      visualvm --jdkhome "C:\Program Files\Java\jdk1.7.0_13" --userdir "C:\Documents and Settings\Alex\AppData\Roaming\VisualVM\1.3.7" 
Was it helpful?

Solution

OK, so VisualVM is simply going to look at the JVMs running. When you have a Web application running within Glassfish, there is a JVM that contains Glassfish (inside of which your web application is hosted). VisualVM is only able to see what is running at the JVM layer. It's not going to look at the JVM hosting glassfish any differently than it would if you directly ran a Java class using the command-line approach.

Unless there is a VisualVM plugin for Glassfish out there that knows how to query the relevant JMX beans to extract the Container details defined within, stock-standard VisualVM will just look at the container as any other JVM.

If you want to see what Web Applications (or anything else, for that matter) are deployed within your Glassfish container, you could use it's web console, or its JMX interface if you want to programmatically inspect it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top