LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-07-2013, 11:02 AM   #1
jdepp
LQ Newbie
 
Registered: Mar 2013
Posts: 12

Rep: Reputation: Disabled
jconsole failed to connect to linux server


I am new to linux and just deployed a java program to run on a linux server. I tried to connect from my windows machine to the linux box with jconsole and got an error.

Code:
Connection Failed: non-JRMP server at remote endpoint
I searched online and found the following suggestion was to run the following:

Code:
java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=
[YOUR PORT] -Dcom.sun.management.jmxremote.ssl=
false -Dcom.sun.management.jmxremote.authenticate=false -jar [YOUR JAR NAME]

I entered the following into a batch file and executed it. I then tried to connect using jconsole using the follow command

Code:
service:jmx:rmi:///jndi/rmi://ipaddress:port/jmxrmi
as suggested but still cannot
(Connection failed: retry)/


Also I have tried different ports as well.

Last edited by jdepp; 05-07-2013 at 11:52 AM.
 
Old 05-08-2013, 09:13 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,662

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by jdepp View Post
I am new to linux and just deployed a java program to run on a linux server. I tried to connect from my windows machine to the linux box with jconsole and got an error.
Code:
Connection Failed: non-JRMP server at remote endpoint
I searched online and found the following suggestion was to run the following:
Code:
java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=
[YOUR PORT] -Dcom.sun.management.jmxremote.ssl=
false -Dcom.sun.management.jmxremote.authenticate=false -jar [YOUR JAR NAME]
I entered the following into a batch file and executed it. I then tried to connect using jconsole using the follow command
Code:
service:jmx:rmi:///jndi/rmi://ipaddress:port/jmxrmi
as suggested but still cannot
(Connection failed: retry)/
Also I have tried different ports as well.
Well, as with any question, details help. Things like what version/distro of Linux, how your Windows machine is connecting to the Linux system (internal corporate LAN? Behind a DMZ? Firewall? VPN?), etc.

Chances are if you tried different ports and can't connect to ANY of them, you've got the ports blocked on the Linux system with IPtables/selinux/firewall-of-some-sort. But the first thing to check is obviously; is the program on the Linux box actually RUNNING, and LISTENING?? Connect to it on the local Linux system first, and verify that it's working. From there, you can (as root), run "iptables -L", to see what your iptables rules are.
 
Old 05-08-2013, 11:04 AM   #3
jdepp
LQ Newbie
 
Registered: Mar 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
thanks so much for your response. Was losing hope here.

firstly, machine OS

Linux version 2.6.18-348.4.1.el5xen (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)) #1 SMP

the iptables setup;
[root@Xen113a ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


I am part of a VPN with a firewall so will contact the network admin to find out but others in the office say they havent had any issues connecting to other machines which are located in the same datea center as mine and they are not very helpful.

Ok so I had the admin guy disable the firewall and tried to telnet to that server from my machine and it is stuck and seems like it will timeout. So it is probably just the port right?

Last edited by jdepp; 05-08-2013 at 11:11 AM.
 
Old 05-08-2013, 12:05 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,662

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by jdepp View Post
thanks so much for your response. Was losing hope here.

firstly, machine OS

Linux version 2.6.18-348.4.1.el5xen (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)) #1 SMP

the iptables setup;
[root@Xen113a ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


I am part of a VPN with a firewall so will contact the network admin to find out but others in the office say they havent had any issues connecting to other machines which are located in the same datea center as mine and they are not very helpful.

Ok so I had the admin guy disable the firewall and tried to telnet to that server from my machine and it is stuck and seems like it will timeout. So it is probably just the port right?
Nope, since what you posted shows that there aren't any firewall rules in place blocking ports. And "connecting" is a nebulous term..connecting HOW, to what service?? Logging in via SSH is different than Telnet, which is different than your Java application.

First things first: as suggested before, log DIRECTLY into the Linux system somehow, and run your application on that system, and make absolutely SURE that the application is running, available, and does answer like you want it to, on the port you want it to. From there, you can go further.
 
Old 05-08-2013, 12:06 PM   #5
jdepp
LQ Newbie
 
Registered: Mar 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
thanks got it to work. It had to do with the hostname on the server and I needed to add the following when running my application;

-Djava.rmi.server.hostname=myipaddress

thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to connect to MYQL Server ts7300 Debian 6 09-29-2009 07:06 AM
VNC Failed to connect to server cthomas SUSE / openSUSE 9 10-14-2006 06:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration