SOLR-481: Handle UnknownHostException

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@628955 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Grant Ingersoll 2008-02-19 01:42:22 +00:00
parent 49c896d131
commit 9f25cd201f
2 changed files with 11 additions and 2 deletions

View File

@ -253,6 +253,8 @@ Bug Fixes
16. SOLR-42: HTMLStripReader tokenizers now preserve correct source
offsets for highlighting. (Grant Ingersoll via yonik)
17. SOLR-481: Handle UnknownHostException in _info.jsp (gsingers)
Other Changes
1. SOLR-135: Moved common classes to org.apache.solr.common and altered the
build scripts to make two jars: apache-solr-1.3.jar and

View File

@ -23,6 +23,7 @@
<%@ page import="org.apache.solr.core.Config"%>
<%@ page import="org.apache.solr.util.XML"%>
<%@ page import="org.apache.lucene.LucenePackage"%>
<%@ page import="java.net.UnknownHostException" %>
<%
@ -46,8 +47,14 @@
}
String collectionName = schema!=null ? schema.getName():"unknown";
InetAddress addr = InetAddress.getLocalHost();
String hostname = addr.getCanonicalHostName();
InetAddress addr = null;
String hostname = "unknown";
try {
addr = InetAddress.getLocalHost();
hostname = addr.getCanonicalHostName();
} catch (UnknownHostException e) {
//default to unknown
}
String defaultSearch = "";
{