File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes NoRouteToHostException when the system starts with no network connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "NoRouteToHostException when the system starts with no network connection" Watch "NoRouteToHostException when the system starts with no network connection" New topic
Author

NoRouteToHostException when the system starts with no network connection

Gurumoorthy Doraiswamy
Greenhorn

Joined: Jan 15, 2013
Posts: 21
Hi,

We have UDP client which we run as windows service using Java service wrapper. My problem is when the system starts with no network connection and when the service starts automatically i receive the "NoRouteToHostException".

How to resolve this? we tried with Datagramsocket.setReuseAddress(true) but still no use. The Datagramsocket.isconnected() always return false.

Can anyone suggest how to resolve this.

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12671
    
    5
Can you catch the Exception and set up a loop with a timer to check for a connection - say - once a minute?

Bill

Java Resources at www.wbrogden.com
Gurumoorthy Doraiswamy
Greenhorn

Joined: Jan 15, 2013
Posts: 21
Many thanks for the update.

I have performed the same for now to fix the issue. But is there any option like checking the datagram connected state ... etc.,

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoRouteToHostException when the system starts with no network connection
 
Similar Threads
vmware & Websphare Application server /Websphere Portal
Access Network drive through Java Application running as a service
Domain Address for JBOSS
IBM Test 667 - SOA ( What should I study? )
Expected behaviour of server when no network connection?