在
D:jakarta-tomcat-5.0.28confCatalinalocalhost
添加
tomcatwebroot.xml
内容如下:
<Context debug="5" docBase="E:/tomcat/tomcatwebroot"
path="/tomcatwebroot" reloadable="true" privileged="true">
</Context>
<Context debug="5" docBase="E:/tomcat/tomcatwebroot"
path="/tomcatwebroot" reloadable="true" privileged="true">
</Context>
可是在启动服务时候出现以下错误:
信息: Processing Context configuration file URL file:D:jakarta-tomcat-5.0.28confCatalinalocalhosttomcatwebroot.xml
2007-4-13 17:07:22 org.apache.catalina.startup.ContextConfig applicationConfig
信息: Missing application web.xml, using defaults only StandardEngine[Catalina].StandardHost[localhost].StandardContext[/tomcatwebroot]
2007-4-13 17:07:22 org.apache.catalina.core.StandardHostDeployer install
2007-4-13 17:07:22 org.apache.catalina.startup.ContextConfig applicationConfig
信息: Missing application web.xml, using defaults only StandardEngine[Catalina].StandardHost[localhost].StandardContext[/tomcatwebroot]
2007-4-13 17:07:22 org.apache.catalina.core.StandardHostDeployer install
网上搜查了很多资料还是没有查出为什么
经过观察分析 我发现以下提示信息:
信息: Installing web application at context path /jsp-examples from URL file:D:jakarta-tomcat-5.0.28webappsjsp-examples
2007-4-13 17:07:23 org.apache.catalina.core.StandardHostDeployer install
信息: Installing web application at context path /servlets-examples from URL file:D:jakarta-tomcat-5.0.28webappsservlets-examples
2007-4-13 17:07:23 org.apache.catalina.core.StandardHostDeployer install
信息: Installing web application at context path /tomcat-docs from URL file:D:jakarta-tomcat-5.0.28webappstomcat-docs
2007-4-13 17:07:23 org.apache.catalina.core.StandardHostDeployer install
信息: Installing web application at context path /webdav from URL file:D:jakarta-tomcat-5.0.28webappswebdav
2007-4-13 17:07:23 org.apache.catalina.core.StandardHostDeployer install
信息: Installing web application at context path /ShopOnLine from URL file:D:jakarta-tomcat-5.0.28webappsShopOnLine
2007-4-13 17:07:23 org.apache.catalina.core.StandardHostDeployer install
2007-4-13 17:07:23 org.apache.catalina.core.StandardHostDeployer install
信息: Installing web application at context path /servlets-examples from URL file:D:jakarta-tomcat-5.0.28webappsservlets-examples
2007-4-13 17:07:23 org.apache.catalina.core.StandardHostDeployer install
信息: Installing web application at context path /tomcat-docs from URL file:D:jakarta-tomcat-5.0.28webappstomcat-docs
2007-4-13 17:07:23 org.apache.catalina.core.StandardHostDeployer install
信息: Installing web application at context path /webdav from URL file:D:jakarta-tomcat-5.0.28webappswebdav
2007-4-13 17:07:23 org.apache.catalina.core.StandardHostDeployer install
信息: Installing web application at context path /ShopOnLine from URL file:D:jakarta-tomcat-5.0.28webappsShopOnLine
2007-4-13 17:07:23 org.apache.catalina.core.StandardHostDeployer install
说明我们新建立的发布目录tomcatwebroot并不是我们以为的Tomcat的webapps目录
而是这个目录的子目录 所以这个添加的Context元素下的应该是一个Web应用的根目录,让Tomcat识别出来这个Web应用
所以我们可以配置一下:在
E:tomcattomcatwebroot下添加WEB-INF再在里面建立一个web.xml
现在再启动Tomcat会发现启动正常:
信息: Processing Context configuration file URL file:D:jakarta-tomcat-5.0.28confCatalinalocalhosttomcatwebroot.xml
2007-4-13 17:16:23 org.apache.catalina.core.StandardHostDeployer install
2007-4-13 17:16:23 org.apache.catalina.core.StandardHostDeployer install