tomcat作虚拟主机出现的问题
我的环境:
tomcat5.27作jsp 虚拟主机
在server.xml中,在<Host>;</Host>;中,只有如下配置才有效
<Host name="localhost" debug="0" appBase="/tomcat5/webapps"
如果把localhost改成别的在互联网上可用的域名,都无法解析servlet类。
但可以解析.jsp文件。请问是什么问题。
如果不用localhost出现的问题如下:
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1074)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:420)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:269)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1176)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:454)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NullPointerException
org.apache.jsp.enterprise.ent_jsp._jspService(ent_jsp.java:211)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1074)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:420)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:269)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1176)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:454)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.0.27