• Post Reply Bookmark Topic Watch Topic
  • New Topic

getLocalHost() throwing UnknownHostException  RSS feed

 
James Swan
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.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!