Understanding context.xml in tomcat 6

后端 未结 2 1560
一生所求
一生所求 2021-02-09 21:15

I created a mainly empty dynamic web project in eclipse.

It has

  • no servlets
  • no jsp files

The web.xml is



        
相关标签:
2条回答
  • 2021-02-09 21:33

    Your question is a tad ambiguous but I'll give it a try.

    Delete the textprojekt.xml that you edited, make those same changes in the context.xml for your project, and restart tomcat.

    It may be caused by a conflict between the two xml files. Changing the xml file that is created by tomcat does nto change the context.xml file for the webapp. At least it doesn't change on tomcat6.0.18 that I use for dev work.

    Hope that's helpful.

    0 讨论(0)
  • 2021-02-09 21:39

    I think this is a bug in Tomcat. I filed a bug report but they claim it works as designed. Tomcat has 3 modes of deployment: Directory, WAR and Context Fragment. In your case, it gets confused when reloading.

    Here is the sequence leading to the error,

    1. When you deploy the WAR, the context fragment (META-INF/context.xml) is copied to conf/Catalina/[host] directory.
    2. When you modifies the fragment, it correctly detects the change so redeployment is triggered.
    3. However, it forgets this is a WAR deployment and treats it as Directory deployment. The directory is removed by undelpoy so you get the error.

    If you only change the XML in META-INF, everything should work for you.

    0 讨论(0)
提交回复
热议问题