4 Replies Latest reply on Mar 4, 2011 4:23 PM by jtahlborn

    visualvm tomcat problem

      I'm trying to profile tomcat server with visualvm.
      In sampler tab I get
      Memory sampling: Not available. Failed to read objects in target application. Check the logfile for details (use Help | About | Logfile).
      com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
           at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:82)
           at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:46)
           at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:195)
           at com.sun.tools.visualvm.attach.AttachModelImpl.getVirtualMachine(AttachModelImpl.java:124)
      Caused: java.io.IOException: Unable to open socket file: target process not responding or HotSpot VM not loaded

      This problem occured after upgrade form jdk6 update 22 to update24.
      In update 22 solution was using the same user to run visualvm and tomcat, but in update 24 it does not solve the problem.

      I'm using
      Ubuntu 10.10
      java version "1.6.0_24"
      Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
      Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)

      I would really appreciate any help.
        • 1. Re: visualvm tomcat problem
          I'm having the same problem on Red Hat Enterprise Linux v5.5 with jdk- and am also interested in the answer.

          • 2. Re: visualvm tomcat problem
            Are you running visualvm as the same user that's running tomcat?

            I tried running visualvm as the root user, but tomcat is being run by daemon and I got the same error you did.

            Running visualvm as the daemon user allowed for profiling to work correctly.
            • 3. Re: visualvm tomcat problem
              Yes, I run VisualVM and Tomcat as the same user. That was the solution using jdk6 update22 but after upgrading to jdk6 24 it does not solve the problem.
              • 4. Re: visualvm tomcat problem
                jvisualvm (on unix/linux) uses a local file to establish communication to the process. i think the attach api tries to generate a file in the current dir of the process or the temp directory. i've had connection problems when the permissions on the these directories were problematic. i can't necessarily say what is "required" because it was kind of trial and error, but (assuming you are running both processes as the same user) i'd check out the filesystems next for permission problems.