You should not define your Context elements in server.xml. That is very bad practice and has been discouraged by the Tomcat authors since about Tomcat3.
It's better to either make them individual files in TOMCAT_HOME/conf/Catalina/localhost or as META-INF/context.xml files in the WARs.
If you go the conf/Catalina/localhost route, note that the context path defined in the Context xml will be ignored and the actual context path will be derived from the name of the file containing the Context. So you'd have to name those files "A.xml" and "B.xml".
Your biggest problem, I think is that you attempted to define the webapps using the server.xml
Host element when you should be using a
Context element (but
not in server.xml!) A Host can contain multiple Contexts, but you normally only have one Host, which by default would be named "localhost". It's what determines that the Context directory is conf/Catalina/localhost instead of conf/Catalina/xyz.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.