Win a copy of Spark in Action this week in the Open Source Projects forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

getLocalHost() throwing UnknownHostException

 
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

we have just started getting UnknownHostException being thrown fairly regulary when using the following code, when updating from Java 1.4.1 to Java 1.4.2



Background:
The above piece of code is called from a Servlet, that gets fairly high traffic (possible problem?).

Details:
OS - Solaris 9
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Server VM (build 1.4.2_04-b05, mixed mode)

Also, I have added the IP address & hostname into the machines /etc/hosts file.

This did not happen when we were using an older version of Java:
java version "1.4.1_02a"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02a-b01)
Java HotSpot(TM) Server VM (build 1.4.1_02a-b01, mixed mode)

Anyone experienced similar issues, or have some suggestions?

Thanks,
James.
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(quoting 1.5 javadocs)

I don't know, whether the invocation of the Security-Manager is new to 1.4.2.

You didn't install a firewall by accident at about the same time?
[ June 02, 2004: Message edited by: Stefan Wagner ]
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The environment didn't change, apart from upgrading the version of Java.

I think I'll probably end up just making this call once when the application server starts up and store it somewhere.

Again, it seems the call from Java to get local host fails intermittently when under load, but equilvalent OS level calls (eg. nslookup, host etc) do not fail under load.

Thanks,
James.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic