0

I'm working on a web application using Tomcat 8 and I've been trying to get a custom session manager working. The problem is that I can't get Tomcat to recognize my context.xml file that contains the <Manager .../> config.

My server.xml looks like this:

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

  <Context path="" docBase="/var/www/" override="true" reloadable="false" />

I've tried putting my context.xml into /var/www/META-INF and in /var/www/WEB-INF/META-INF. I've also tried putting my <Manager .../> configuration under the Context element in the server.xml shown above, and that does work, but the docs advice against putting things in there.

RTF
  • 6,214
  • 12
  • 64
  • 132
  • 1
    Have you tried putting it in the /META-INF of your web-app? Where it's supposed to go? – user207421 May 22 '16 at 18:13
  • I thought that by putting it in META-INF in `/var/www` I was putting it into the web-app. Is that not where it should go? – RTF May 22 '16 at 18:18

1 Answers1

0

You have specified the <Context .../> element in server.xml so any context.xml file you include in your application will be ignored.

Mark Thomas
  • 16,339
  • 1
  • 39
  • 60
  • But if I don't specify a Context element like I have in the server.xml, then how does Tomcat know where the webapp is when it starts? – RTF May 23 '16 at 12:42
  • Put the web app in the Host's appBase and let automatic deployment take care of it. Then any context.xml packaged in the web app will be processed. – Mark Thomas May 27 '16 at 10:15