tomcat 不选择 context.xml,它被复制到 CATALINA_HOME>conf>Catalina>localhost [英] tomcat does not pick the context.xml, it is getting coopied to CATALINA_HOME> conf>Catalina>localhost though

查看:45
本文介绍了tomcat 不选择 context.xml,它被复制到 CATALINA_HOME>conf>Catalina>localhost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 context.xml(在 META_INF 中)文件夹如下所示:

My context.xml (in META_INF) folder looks like this:

<?xml version="1.0" encoding="UTF-8"?>


<Context path="MY_CONTEXT_NAME" docBase="${catalina.home}/webapps/MY_APP_NAME"
        debug="0" privileged="true">

</Context>

问题是,当我通过 tomcat 管理器部署我的应用程序 war 时,context.xml 被复制到 CATALINA_HOME> conf>Catalina>localhost 文件夹.但是,它仍然以某种方式从默认上下文进行部署,即 app_war_name.

The problem is, context.xml is getting copied to the CATALINA_HOME> conf>Catalina>localhost folder when I deploy my application war via tomcat manager. However, it is somehow still deploying from default context, that is , app_war_name.

早些时候,它甚至没有被复制到 localhost 文件夹,我删除了默认的 context.xml 表单 tomcat 6.0>conf 文件夹.在那之后,文件至少被复制了.但是,部署不是从显式 context.xml 发生的.

Earlier, it was not even getting copied to localhost folder, I removed the default context.xml form tomcat 6.0>conf folder. After that, the file is at least getting copied. However, the deployment is not happening from the explicit context.xml.

我的 server.xml 主机条目如下所示:

My server.xml host entry looks like this :

  <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="false"
            xmlValidation="false" xmlNamespaceAware="false" >
  </Host> 

推荐答案

如果您使用新的上下文或更改的上下文再次部署,您需要先取消部署/或从 conf/.../localhost/yourapp 中删除 context.xml.xml

if you deploy again with new context or changed context you need to un-deploy first/ or remove context.xml from conf/.../localhost/yourapp.xml

这篇关于tomcat 不选择 context.xml,它被复制到 CATALINA_HOME>conf>Catalina>localhost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆