• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.net.ConnectException: Connection timed out

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
I am unable to get the response from the server for particular IP address.I tried with another URL in my program working very well when the IP address of that server is changed
i am getting the following exception java.net.ConnectException: Connection timed out.can anybody please let me know the possibilities that leads to this exception, so that i can change the settings in my midlet.
I can undoubtably say that the problem is with the server not with the midlet.
expecting the soon response from you people
lakshman
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"laksh killer" please check your private messages for an important administrative matter. You can see them by clicking the My Private Messages link above.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
public class ConnectException extends SocketException

It just signals that an error occurred while attempting to connect a socket to a remote address and port. Typically, the connection was refused remotely (e.g., no process is listening on the remote address/port). Or a firewall perhaps, blocking your request ..

Actually Its a 504 Gateway Timeout I guess...

Connection timeouts occur when:

� The IP address for the requested server is successfully found
� Connection establishment packets are dispatched to the IP address
� The destination address deliberately ignores or does not receive them

Similar to connection timeout is Connection Refused, but in this case the destination system is actually sending packets back saying "go away, there is no service running on the port you are trying to connect to"

Your packets are just being lost.. either the system or some intermediate system is firewalled.. if you can't connect using telnet, a browser or some other app, its a network problem, not java's..


[ December 03, 2008: Message edited by: Mantaker Here ]

[ December 03, 2008: Message edited by: Mantaker Here ]
[ December 03, 2008: Message edited by: �Mantaker� ]
 
lakshman kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Mantaker,
Thanks for your reply, i came to know that the problem is from the server side, can you please tell me the way to configure the server.because in the server side i am using the IIS6.0, then i am unable to get the response.if the server is tomcat then i am not facing any problem.I can able to get the response.
I tried to include the mime type and also, but the use was nill.Please reply me as soon as possible.
once again thanks for your quick reply
lakshman
 
Amit Ghorpade
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"�Mantaker�" please check your private messages for an important administrative matter. You can see them by clicking the My Private Messages link above.
 
Rajaraja Chozhan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Due to moderator's request I changed my name .. Well, I'm Mantaker here ..

Let me know what you wanna do? Actually, If it is http request alone, You can use tomcat itself .. But comparing IIS with tomcat is unfair .. You can Interface Tomcat with IIS (Bridge) .. For that, You'll find umpteen number of resources on the web .. I personally suggest you to use the tomcat..

But, Need some more clarity about the problem!!

Thank you ..
[ December 04, 2008: Message edited by: Raja Raja Chozhan M A ]
 
Amit Ghorpade
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Raja Raja Chozhan M A " thank you for the update but if you look at the Naming policy, then it says that

You can even use an initial or initials for the first name if you like (but not the last).


So you need another update
[ December 04, 2008: Message edited by: Amit Ghorpade ]
 
lakshman kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi raja,
The problem is the server is already established one.I am working on the Mobile version of the application.So i can't change the server which is running already.
The server application is .net application.I checked both phone log files and iis log files, in the IIS log files.
In the phone log file it is giving the exception as
java.net.socketException: connection refused
in the iis log file, some bytes were missing from delivering.So i am really confused at this point of time, on the way i have to proceed.Can you please guide me , thanks for your help in advance
lakshman
 
Rajaraja Chozhan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear moderator .. Is it ok now?? Well lakshman, I'll get back to you, running out of a small work..
 
Amit Ghorpade
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes until someone else thinks that Rajaraja is fake
In my opinion Raja Chozhan will not lead to any problems
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Amit Ghorpade:
Yes until someone else thinks that Rajaraja is fake



We're not out to give anyone a hard time here. We're just trying to be professional (even if our mascot is a moth-eaten hunting trophy!).

A "real-looking" name is all we ask. Providing it's truly real and not the name of a celebrity, fictitious character, deity, or other blatant poke in the eye at our dignity. And even those are OK if you can convince us it's not a pseudonym. After all, sometimes people really do have names like that!

One reason we have the naming policy is that first and foremost the JavaRanch is supposed to be a place where you can ask really stupid questions (in some people's opinion, anyway) and still get a respectful answer. "Handles" or pseudonyms provide cover for flamers, so by rejecting such things, we encourage civil discussion. And civil discussion is altogether too rare these days no matter where you go.

Anyway, to address the actual question: A connection timeout can occur for a number of reasons. If the network interface is down, if DNS is required, but the name cannot be resolved, if a data transmission is in progress and stalls due to lack of response from the other end or noise on the channel (more common on mobile devices than on hardwired networks).

Usually you can track this back to a root cause. It's always a good idea to check the stack trace for a "caused by" exception.
 
Rajaraja Chozhan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys .. Rajaraja chozhan is my real name .. Well, lakshman can you please answer the following things?

� What IDE are you using?
� If you need to connect the client (Mobile) to an IIS server, then why did you connect it to tomcat? There is no need of doing it even for testing purposes I guess..
� Well, can you post the piece of code which made the exception arise?

thanks
[ December 06, 2008: Message edited by: Rajaraja Chozhan ]
 
Amit Ghorpade
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hey guys .. Rajaraja chozhan is my real name ..


Glad to know
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

did you find a soultion for this problem, since I am facing a similar one :-)
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Faiza!

You've awakend a "zombie" thread. All these people have probably been laid off and moved on to other companies by now. You really should have started your own thread instead.

However, the number one reason for a "Connection timed out" error is lack of ability to connect. Whether it's desktop web browser or mobile device web service, the problem is the same. Usually, either access is blocked (because of a firewall) or there's no network path. In cases of mobile devices, this is often because the device doesn't have a telephone-service provided internet connection.
 
reply
    Bookmark Topic Watch Topic
  • New Topic