participate


Debugging Tools and Techniques - debugging jconsole connection
<<   Back to Forum  |   Give us Feedback
This topic has 7 replies on 1 page.
dberansky
Posts:381
Registered: 7/23/97
debugging jconsole connection   
May 17, 2006 10:53 AM

 
Hi,

Is there a way to debug why I get "Connection failed" from JConsole?

I have JMXRemote enabled on the JVM I want to monitor (I can telnet to the jmx port manually from the computer running JConsole). I've setup a password file and made sure I don't get JMX related error messages when starting the application (tomcat). Everything seems set, yet I get "Connection failed" when trying to connect to the JVM.

Any ideas?

Thanks
Dmitry
 
Caffeine0001
Posts:1,276
Registered: 1/9/04
Re: debugging jconsole connection   
May 17, 2006 3:03 PM (reply 1 of 7)  (In reply to original post )

 
If you are behind a NAT or firewall you need to do additional work. The second reply of http://forum.java.sun.com/thread.jspa?threadID=289869&messageID=1242288 had the answer.

Also see:
http://java.sun.com/j2se/1.4/docs/guide/rmi/faq.html#nethostname
http://forum.java.sun.com/thread.jspa?forumID=4&threadID=565139

In short it has to do with the system property java.rmi.server.hostname and setting to a name that resolve correctly inside and outside the firewall.
 
dberansky
Posts:381
Registered: 7/23/97
Re: debugging jconsole connection   
May 18, 2006 12:18 AM (reply 2 of 7)  (In reply to #1 )

 
Nope, there is no NAT. Both machines are on the same subnet, actually.
 
dfuchs
Posts:416
Registered: 1/5/06
Re: debugging jconsole connection   
May 19, 2006 5:33 AM (reply 3 of 7)  (In reply to #2 )

 
Hi,

The JMX RMI Connector is secure by default. Did you configure security properly on client & server side (keystore/truststore etc...)?

If it's just for testing, you could try first with security disabled. See instructions
there: disable SSL and password authentication.

http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#remote

-- daniel
JMX, SNMP, Java, etc...
http://blogs.sun.com/roller/page/jmxetc
 
vamsee
Posts:6
Registered: 7/8/97
Re: debugging jconsole connection   
May 25, 2006 3:38 PM (reply 4 of 7)  (In reply to #2 )

 
Hi,

The properties
-Dcom.sun.management.jmxremote.authenticate=false and
-Dcom.sun.management.jmxremote.ssl=false go together. For a while I just set the first property to false and jconcole just won't connect to the remote server. After I set both it works. Its in the docs but easy to miss.

Vamsee
 
sbutton
Posts:1
Registered: 8/25/97
Re: debugging jconsole connection   
May 30, 2006 6:16 PM (reply 5 of 7)  (In reply to original post )

 
Is there a way to enable debugging or at least display stack traces from jconsole -- I am still having trouble connecting to a JMX enabled server (OC4J) from jconsole whereas a direct JMX client connects in OK.

I've tried the authentication flags shown below to no avail.

I'd like to at least see what jconsole is doing and what error it is seeing.
 
dfuchs
Posts:416
Registered: 1/5/06
Re: debugging jconsole connection   
Jun 7, 2006 2:58 AM (reply 6 of 7)  (In reply to #5 )

 
Hi,

Yes, you can switch on JMX traces with the following flags:

jconsole -J-Djava.util.logging.config.file=<logging.properties>

where <logging.properties> is your logging.properties files.

A few times ago I have blogged about how to switch on the JMX traces and
gave a description of the JMX loggers and logging properties:
http://blogs.sun.com/roller/page/jmxetc?entry=tracing_jmx_what_s_going

You can use the logging.properties file I have shown there:
http://blogs.sun.com/roller/resources/jmxetc/logging.properties
If you're trying to debug connection problems I'd recommend you switch the
javax.management.remote logger to FINEST - and not to FINER as shown in
the file.

If it's a security related problem (using SSL) you may also want to use
-J-Djava.security.debug=all
or if you want to reduce the amount of security traces you can get a list
of debug options by typing:
java -Djava.security.debug=help foo
See
http://java.sun.com/developer/onlineTraining/Security/Fundamentals/Security.html
for more info on java.security.debug.

And if you're new to JMX/JConsole you may find this article interesting:
http://blogs.sun.com/roller/page/jmxetc?entry=where_can_i_get_my

Hope this helps,

-- daniel
JMX, SNMP, Java, etc...
http://blogs.sun.com/roller/page/jmxetc

Message was edited by:
dfuchs
I have now written a blog entry about this subject:
http://blogs.sun.com/roller/page/jmxetc?entry=troubleshooting_connection_problems_in_jconsole
 
gnits
Posts:2
Registered: 2/28/07
Re: debugging jconsole connection   
Feb 28, 2007 1:08 AM (reply 7 of 7)  (In reply to original post )

 
able to perform the local monitoring for jconsole with pid and portnumber....But while trying with remote monitoring from different physical system its giving an error either connection failed or unkown hosts....unable to resolve the problem....please help me
 
This topic has 7 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 64
  • Guests : 124

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums