环境: win2000 pro + tomcat 4.0.1.24
问题:把 Struts-blank.war包拷贝到 tomcat的webapps目录下,在server.xml上添加内容:
<!-- Struts-blank Context -->
<Context path="/Struts-blank" docBase="Struts-blank.war" debug="0"
reloadable="true" crossContext="true">
</Context> ,
启动后,发现tomcat加载一些内容,但是访问http://localhost:8080/Struts-blank/index.jsp 却报异常:
org.apache.jasper.JasperException: Missing message for key index.title
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
我发布的是struts的Struts-blank.war,请问如何解决?是不是struts的发布要做一些其他处理?
5 个解决方案
另外,在tomcat启动并加载的时候,出了异常:
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at common.ParentDBBean.getPooledConnection(ParentDBBean.java:517)
at common.ParentDBBean.initialize(ParentDBBean.java:295)
at common.dispatch.LoadInitPara.init(LoadInitPara.java:61)
应该是我在server.xml中没有配置数据库连接池和数据源导致,那么如何配置,请指教,谢谢!
<Context path="/Struts-blank" docBase="Struts-blank.war" debug="0"
reloadable="true" crossContext="true">
</Context>
多此一举,将Struts-blank.war包拷贝到 tomcat的webapps目录下,直接http://localhost:8080/Struts-blank/就可以了!
是呀,其实不需要在配置文件写<Context>的(特殊需要除外)