I have a strange effect defining a tomcat context element. With development i used META-INF/context.xml. On deployment it's $TOMCAT_HOME/conf/engine/myfooservice.xml
Is a plain simple context def - path and datasource:
<Resource
name="dataSourceName"
type="javax.sql.DataSource"
password="s3cr3t"
driverName="oracle.jdbc.OracleDriver"
maxIdle="32"
maxWaitMillis="5000"
username="stupidLooser"
url="jdbc:oracle:thin:@HHHHHHH:1521:XXX"
maxTotal="64"/>
Using META-INF it work's as expected. Using $TOMCAT_HOME/conf/engine/myapp.xml there is a different behaviour with URLs.
Some 'App' calls a rest Service (myfooservice) to display some information before realm login on the login screen. App ---AJAX----> myfooservice on same Tomcat (/App /myfooservice).
Using $TOMCAT_HOME/conf/engine/myapp.xml the url on login is changed to http://$host:$port/APPContext/index/$myfooserviceCONTEXT/RestURL which is pretty wrong - non existent (all browsers). Breaks login.
Using META-INF/context.xml the login work's as expected. j_security is called and the final URL is http://$host:$port/APPContext/index (all Browsers) as expected.
I have no idea why $TOMCAT_HOME/conf/engine/myfooservice.xml behaves differently. From the docs i would conclude that there is no difference.