VisualVM
  1. VisualVM
  2. VISUALVM-476

Unable to do Profile for Tomcat app, does not automatically connect

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.3
    • Fix Version/s: None
    • Component/s: code
    • Labels:
      None
    • Environment:

      Linux RedHat Enterprise 5

      Description

      Installed VisualVM 1.3.3, started application from command line, answered license question. Observed startup screen, only application listed on left panel under local is VisualVM. There was already a running tomcat6 application. I made a JMX connection to the application, when I browsed the application, there was no tab visible for Profiling.

      1. messages.log
        12 kB
        markie44
      2. tomcat_processes.log
        6 kB
        markie44
      3. visualvm.messages.log
        16 kB
        markie44
      1. alert.jpg
        9 kB
      2. VisualVM on tul1cpgtapp2.png
        46 kB

        Activity

        Hide
        markie44 added a comment - - edited

        Additional information: I reconnected, now I do not even see MBeans tab. Under Sampler, CPU sampling, it never changes from "Checking availability..." and Memory sampling says "Not available. Cannot connect to target application." I can change CPU settings by clicking Edit button, but anything saved there does not appear under Preset menu next to Edit button. Sample buttons never become enabled. Attaching process list showing all processes run by user 'tomcat' which is running the App and VisualVM.

        Updating 15-Nov-2011:
        Discovered this problem is due to bug in JVM (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7009828), work-around is to launch visualvm with explicit link to temp dir. Once this is done, application discovery and profiliing is available.

        Unfortunately, this exposed another issue, profiling is blocked by this alert: "Unable to open socket file: target process not responding or HotSpot VM not loaded"

        Show
        markie44 added a comment - - edited Additional information: I reconnected, now I do not even see MBeans tab. Under Sampler, CPU sampling, it never changes from "Checking availability..." and Memory sampling says "Not available. Cannot connect to target application." I can change CPU settings by clicking Edit button, but anything saved there does not appear under Preset menu next to Edit button. Sample buttons never become enabled. Attaching process list showing all processes run by user 'tomcat' which is running the App and VisualVM. Updating 15-Nov-2011: Discovered this problem is due to bug in JVM ( http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7009828 ), work-around is to launch visualvm with explicit link to temp dir. Once this is done, application discovery and profiliing is available. Unfortunately, this exposed another issue, profiling is blocked by this alert: "Unable to open socket file: target process not responding or HotSpot VM not loaded"
        Hide
        markie44 added a comment -

        error alert

        Show
        markie44 added a comment - error alert
        Hide
        cnkmym added a comment -

        I do not know why you cannot do Profiling. What I know is how to enable VisualVM to find local Tomcat automatically.

        It is common that VisualVM and JConsole cannot automatically detect Running Tomcat.
        The reason is that Tomcat (with version >=6) will not save its temp files into system default folder (%TEMP%).
        So JConsole and VisualVM cannot find it, then VisualVM thinks there is no Tomcat on running.

        You can add customized "CATALINA_TMP" variable into Tomcat's catalina.bat/catalina.sh file.
        Specify the exact path of system default TEMP folder.
        By doing that, VisualVM can find the local Tomcat automatically.

        By the way, you can google this problem. There are many solutions available online.

        Show
        cnkmym added a comment - I do not know why you cannot do Profiling. What I know is how to enable VisualVM to find local Tomcat automatically. It is common that VisualVM and JConsole cannot automatically detect Running Tomcat. The reason is that Tomcat (with version >=6) will not save its temp files into system default folder (%TEMP%). So JConsole and VisualVM cannot find it, then VisualVM thinks there is no Tomcat on running. You can add customized "CATALINA_TMP" variable into Tomcat's catalina.bat/catalina.sh file. Specify the exact path of system default TEMP folder. By doing that, VisualVM can find the local Tomcat automatically. By the way, you can google this problem. There are many solutions available online.
        Hide
        thurka added a comment -

        To cnkmym: You don't need to change "CATALINA_TMP" variable. The reason that VisualVM cannot find Tomcat is the following JDK bug #7009828 <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7009828>. Please upgrade your JDK to 1.6.0_29 and run bot VisualVM and Tomcat on JDK 1.6.0_29.

        Show
        thurka added a comment - To cnkmym: You don't need to change "CATALINA_TMP" variable. The reason that VisualVM cannot find Tomcat is the following JDK bug #7009828 < http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7009828 >. Please upgrade your JDK to 1.6.0_29 and run bot VisualVM and Tomcat on JDK 1.6.0_29.

          People

          • Assignee:
            thurka
            Reporter:
            markie44
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: