简体   繁体   English

server.xml中定义的tomcat上下文未加载

[英]tomcat context defined in server.xml is not loading

I have a web application deployed on path 我在路径上部署了Web应用程序

/var/lib/tomcat6/webapps/abc/</code>

in server.xml on path /etc/tomcat/server.xml I have added following lines. 在路径/etc/tomcat/server.xml上的server.xml ,我添加了以下几行。

<Context docBase="/var/lib/tomcat6/webapps/abc/" path="/" reloadable="true">

  <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="20" maxIdle="10" maxWait="10000" name="jdbc/abcDB" password="abc" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/abc" username="abc"/>

</Context>

inside the host tag. 在主机标签中。

When I restart tomcat and hit http://localhost:8080/ nothing appears but when I enter http://localhost:8080/abc home page is displayed which means above entry in server.xml is not taking affect. 当我重新启动tomcat并单击http://localhost:8080/什么都没出现,但是当我输入http://localhost:8080/abc主页时,这表明server.xml上述输入未server.xml

What am I doing wrong ?? 我究竟做错了什么 ??

Looks like you want to set webapp abc as the default web app (ie access it directly via http://localhost:8080/ ), then give the path as "" not "/" in Context 看起来您想将webapp abc设置为默认Web应用程序(即直接通过http:// localhost:8080 /对其进行访问 ),然后在Context中将路径指定为""而不是“ /”

From the Tomcat docs, 从Tomcat文档中,

If you specify a context path of an empty string (""), you are defining the default web application for this Host, which will process all requests not assigned to other Contexts 如果您指定一个空字符串(“”)的上下文路径,那么您正在为此主机定义默认的Web应用程序,它将处理所有未分配给其他上下文的请求

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Jenkins Tomcat deploy:上下文是在server.xml中定义的,不能取消部署 - Jenkins Tomcat deploy : Context is defined in server.xml and may not be undeployed 如果没有部署应用程序 <context> 在tomcat的server.xml之外定义 - app is not deploying if <context> defined outside of server.xml in tomcat Tomcat通过server.xml映射上下文 - Tomcat mapping context via server.xml 在openshift中的tomcat server.xml中定义上下文 - Define a context in tomcat server.xml in openshift 如何禁用通过Tomcat中server.xml的Context元素定义的应用程序? - How to disable application defined via Context element of server.xml in Tomcat? Openshift Tomcat,无法找到server.xml和context.xml? - Openshift tomcat, unable to find server.xml and context.xml? Tomcat似乎无视新 <Context> server.xml中的元素 - Tomcat seems to ignore new <Context> element in server.xml 使用Java从Tomcat的server.xml查找上下文路径 - Find context path from Tomcat's server.xml with java 在 tomcat server.xml 中,可以为服务元素定义 AccessLogValve - In tomcat server.xml, can AccessLogValve be defined for service element 失败-在Tomcat 7中出现错误:如果在server.xml中定义了上下文,则无法上传War文件“ WhitePagesAddressLookup.war” - FAIL -Getting error in tomcat7: War file “WhitePagesAddressLookup.war” cannot be uploaded if context is defined in server.xml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM