aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX: getting ConnectException with just ONE thread! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX: getting ConnectException with just ONE thread! " Watch "NX: getting ConnectException with just ONE thread! " New topic
Author

NX: getting ConnectException with just ONE thread!

Paul Tongyoo
Ranch Hand

Joined: Sep 30, 2003
Posts: 91
Hi all -- I'm currently struggling with a ConnectException problem when remote clients (clients outside my WAN environment) try to access my server.
It was relieving to see that this problem isn't a new one, as I've found many threads referring to it -- but unfortunately i've found that none have lead to a specific solution plus they've all been dealing with people getting the exception after multiple clients have connected.
But this happens to me on my very FIRST remote connect attempt! It seems clients are able to recognize the server registry, but when they try retrieving search results, the error occurs. the error message is pasted below:

I'm running WinXP -- i read in a previous thread that Linux users have been able to fix this problem by deleting the 127.0.0.1 entry in their /etc/hosts file -- is there a similar solution for XP users? I imagine this shouldn't be an acceptable solution anyway, since Sun's testers will probably be running under similar ("normal"?) conditions to what my system is at right now?
Also of note: localhost tests and remote client tests on my LAN do succeed.
Just when i have one of my buddies try to connect from Delaware or California is when I get the error.
I greatly appreciate any advice or thoughts.
Paul


Sun Certified Java Web Component Developer for J2EE v1.4<br />Sun Certified Java Developer for J2SE v1.4<br />Sun Certified Java Programmer for J2SE v1.4
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Paul,
Hi all -- I'm currently struggling with a ConnectException problem when remote clients (clients outside my WAN environment) try to access my server.
(...)
Also of note: localhost tests and remote client tests on my LAN do succeed.
Just when i have one of my buddies try to connect from Delaware or California is when I get the error.


If remote client tests on your LAN do succeed while out-of-your-LAN remote client tests fail, I guess your RMI application is OK and you get in trouble because of some security feature installed on your system (firewall). Reading you, I guess you performed those tests at office. Did you tell your network admin about the issue ?
Best,
Phil.
[ October 27, 2003: Message edited by: Philippe Maquet ]
Paul Tongyoo
Ranch Hand

Joined: Sep 30, 2003
Posts: 91
Originally posted by Philippe Maquet:

... you get in trouble because of some security feature installed on your system (firewall). Reading you, I guess you performed those tests at office. Did you tell your network admin about the issue ?

[ October 27, 2003: Message edited by: Philippe Maquet ]

Phil -- thank you for your reply. I am testing my code within my home -- which has three linked comps sharing a single internet connection. I have a LinkSys router distributing NAT addys to my computers. I had thought it may have been a firewall issue, but then I asked one of my non-firewalled buddies to act as server and let me connect to him (which erupted the same ConnectException error).
I know for sure that I am forwarding the correct ports to the correct NAT addy of my laptop via the LinkSys router admin, which I currently believe is the extent of my router's firewalling capabilities (am I wrong?). Furthermore, the fact that I was able to reproduce the error with a non-protected server led me to the conclusion that my problem is in my code somewhere.

Paul
Paul Tongyoo
Ranch Hand

Joined: Sep 30, 2003
Posts: 91
I just figured out the problem(s). It was a combination of my NAT addy being partially-blocked by "hidden" firewalls and the fact that the Naming.(re)bind function was binding my remote object to my NAT addy and not my reachable WAN addy. LinkSys has an option to place one local user in the DMZ, which is completely unblocked by firewalls of the router. I also had to override the default binding address with a command-line argument.
So now i have a potential predicament, since the only way I was able to get it to work was if i use this command line:

According to my specs, this command-line is unacceptable (i can't have that additional argument). I imagine this is only necessary for people behind routers? Will i have to worry about this for my final submission? Is there a way to dynamically bind remote objects to the actual reachable host address (not the localhost addy or NAT addy)?
Thanks again,
Paul
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Paul,
According to my specs, this command-line is unacceptable (i can't have that additional argument). I imagine this is only necessary for people behind routers? Will i have to worry about this for my final submission? Is there a way to dynamically bind remote objects to the actual reachable host address (not the localhost addy or NAT addy)?

It's acceptable because it's not a command-line argument of your application but of the JVM. By doing so, you're just setting a system property and it's OK IMO. You may document the issue, but even if you don't, I think you are OK.
Best,
Phil.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NX: getting ConnectException with just ONE thread!