The Java.net.UnknownHostException Solution

Source: Internet
Author: User
Tags solr
When using Java today, you encounter the following problems.

Org.apache.jasper.JasperException:Exception in JSP:/admin/_info.jsp:43

40:}
41:
42:string CollectionName = schema!=null? Schema.getname (): "Unknown";
43:inetaddress addr = Inetaddress.getlocalhost ();
44:string hostname = Addr.getcanonicalhostname ();
45:
46:string defaultsearch = "";


StackTrace:
Org.apache.jasper.servlet.JspServletWrapper.handleJspException (jspservletwrapper.java:467)
Org.apache.jasper.servlet.JspServletWrapper.service (jspservletwrapper.java:377)
Org.apache.jasper.servlet.JspServlet.serviceJspFile (jspservlet.java:315)
Org.apache.jasper.servlet.JspServlet.service (jspservlet.java:265)
Javax.servlet.http.HttpServlet.service (httpservlet.java:803)
Org.apache.solr.servlet.SolrDispatchFilter.doFilter (solrdispatchfilter.java:133)

Root cause

Java.net.UnknownHostException:app10:app10
Java.net.InetAddress.getLocalHost (inetaddress.java:1308)
Org.apache.jsp.admin.index_jsp._jspservice (index_jsp.java:95)
Org.apache.jasper.runtime.HttpJspBase.service (httpjspbase.java:98)
Javax.servlet.http.HttpServlet.service (httpservlet.java:803)
Org.apache.jasper.servlet.JspServletWrapper.service (jspservletwrapper.java:328)
Org.apache.jasper.servlet.JspServlet.serviceJspFile (jspservlet.java:315)
Org.apache.jasper.servlet.JspServlet.service (jspservlet.java:265)
Javax.servlet.http.HttpServlet.service (httpservlet.java:803)
Org.apache.solr.servlet.SolrDispatchFilter.doFilter (solrdispatchfilter.java:133)

This is a problem caused by a java/dns, the possible causes are:

1 uses an unsuitable host name and cannot perform DNS resolution host.
2 when the JVM is running, the host name is changed and the host name returned in the cache does not match the server settings.

The solution, that is, two kinds of, first check your server name is set up in the hosts. If everything is correct, refresh the cache of the JVM.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.