Debugging JConsole Connection Failed

后端 未结 8 1149
臣服心动
臣服心动 2020-12-29 04:34

I have a web application deployed to a remote resin server, and it has JMX turned on.

I can telnet to the remote server i.e

franz@see:/tmp$ telnet &l         


        
相关标签:
8条回答
  • 2020-12-29 04:47

    I don't know if this is helpful, but perhaps you should use the the jconsole binary in the JDK bin directory rather than using the undocumented (and subject to change) sun.* classes to start up the console

    0 讨论(0)
  • 2020-12-29 04:56

    if you run jconsole -debug it gives you more diagnostic info on the failure. See the Daniel Fuchs blog entry "Troubleshooting connection problems in JConsole".

    I did this and it showed me I was using 32 bit jconsole the target process was started with a different (64 bit) jvm, so apparently this isn't allowed and it was thus failing.

    0 讨论(0)
  • 2020-12-29 04:58

    I encountered the same Problem when starting the Java-Process through cygwin. JConsole cannot connect. Started it through win7-cmd everything works as expected.

    0 讨论(0)
  • 2020-12-29 05:01

    I was having similar issue that remote machine was behind firewall and firewall was blocking ports defined by -Dcom.sun.management.jmxremote.port and RMI 46924. After allowing me to cnnect to these port I connected succesfully.

    0 讨论(0)
  • 2020-12-29 05:03

    Make sure you are running your application with following java properties set

    -Dcom.sun.management.jmxremote.port=9005
    -Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.ssl=false
    

    Try to connect now. If you want to debug this ,you can run the jconsole with following command

    jconsole -J-Djava.util.logging.config.file=path_to_logging.properties_for_jconsole
    

    Below is the content of logging.properties file

    Logging.properties
    
    handlers = java.util.logging.ConsoleHandler
    
    
    .level = INFO
    
    java.util.logging.ConsoleHandler.level = FINEST
    
    java.util.logging.ConsoleHandler.formatter = \
    
    java.util.logging.SimpleFormatter
    
    // Use FINER or FINEST for javax.management.remote.level - FINEST is
    
    // very verbose...
    
    javax.management.level = FINEST
    
    javax.management.remote.level = FINER
    

    Once you run jconsole a separate window will pop up displaying logs.

    0 讨论(0)
  • 2020-12-29 05:06

    If your application is running on JDK 1.6 then you should be able to connect it. If it is using JDK prior to 1.6 then run it with specifying the following JVM argument

    -Dcom.sun.management.jmxremote

    0 讨论(0)
提交回复
热议问题