You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Britta Koch <bk...@mundwerk.de> on 2005/01/06 09:22:09 UTC

InetAddress.getLocalHost.getHostName() and crashes

Hi!

My web application runs on resin 2.1.10 with a JDK1.5 and call
InetAddress.getLocalHost.getHostName() repeatedly. Disregarding the fact
that this may not be clever, it has worked for quite some time.

When I ported this application to tomcat (5.0.28), I get ugly crashes,
killing the web server completely and leaving me with a stack trace
containing the following:

Stack: [0x048f3000,0x04974000),  sp=0x0497287c,  free space=510k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libc.so.6+0x5a089]  fgets_unlocked+0x29
C  [libnss_files.so.2+0x39d1]  _nss_files_gethostbyname_r+0x141
C  [libc.so.6+0xcf009]  gethostbyname_r+0x119
C  [libnet.so+0x4d61]  Java_java_net_Inet4AddressImpl_getLocalHostName+0x91
j  java.net.Inet4AddressImpl.getLocalHostName()Ljava/lang/String;+0
j  java.net.InetAddress.getLocalHost()Ljava/net/InetAddress;+7

Does anyone have any idea why this might be a problem? I have tried a
workaround that caches the hostname, but I still sometimes crash the
webserver after deploying the web application during the first call to
InetAddress.getLocalHost.getHostName(), so I'd like to fix the problem,
not the symptoms.

Thanx for any pointers, tips or advice.

Britta Koch



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org