Victor, Please do not top post.
Anyway (see at the bottom). On 12/9/2016 8:28 AM, Victor Rodriguez wrote: > Chris, I really don't want double deployment. I'm trying to have a single > abc.war and avoid having to install apache to redirect/rewrite > http://host:8082/xyz to http://host:8082/abc. I was hoping there was a way > to have tomcat send /xyz to abc.war. I suppose I could also just copy > abc.war to xyz.war and have both in the webapps directory, but I'm trying > to avoid that. > > On Fri, Dec 9, 2016 at 8:23 AM, Christopher Schultz < > ch...@christopherschultz.net> wrote: > > Victor, > > On 12/9/16 11:17 AM, Victor Rodriguez wrote: >>>> Chris, a little more progress this morning... >>>> >>>> This is what I currently have in my xyz.xml >>>> >>>> <Context override="true" swallowOutput="true" >>>> docBase="wfsservice.war"> >>>> >>>> And, this is what I get in my catalina.out... >>>> >>>> INFO: Deploying configuration descriptor >>>> /dg/local/cots/tomcat/tomcat_8082/conf/Catalina/localhost/xyz.xml >>>> >>>> ...then... >>>> >>>> WARNING: A docBase >>>> /dg/local/cots/tomcat/tomcat_8082/webapps/abc.war inside the host >>>> appBase has been specified, and will be ignored > > Aah, yes. This is probably because specifying a docBase inside the > appBase usually indicates a mistake that will result in > double-deployment of a web application. But double-deployment is > precicely what you are requesting. > > We'll need to do this then: > > 1. Put abc.war somewhere else > 2. Change the path in xyz.xml to match #1 > 3. Copy xyz.xml to abc.xml in the same directory > 4. Profit > >>>> ...then... >>>> >>>> SEVERE: Error starting static Resources >>>> >>>> java.lang.IllegalArgumentException: Document base >>>> /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist or is >>>> not a readable directory >>>> >>>> So, it looks like it's looking for an exploded xyz directory. > > It might be. But there isn't a stack trace so I have no idea if that > is even being produced by Tomcat. > > -chris > >>>> On Fri, Dec 9, 2016 at 8:07 AM, Christopher Schultz < >>>> ch...@christopherschultz.net> wrote: >>>> >>>> Victor, >>>> >>>> On 12/8/16 7:57 PM, Victor Rodriguez wrote: >>>>>>> On Thu, Dec 8, 2016 at 2:50 PM, Christopher Schultz < >>>>>>> ch...@christopherschultz.net> wrote: >>>>>>> >>>>>>>> Victor, >>>>>>>> >>>>>>>> On 12/8/16 4:59 PM, Victor Rodriguez wrote: >>>>>>>>>>> THANKS IN ADVANCE FOR YOUR HELP! (not yelling, just >>>>>>>>>>> emphasizing!) >>>>>>>>>>> >>>>>>>>>>> I have abc.war and I want both /abc and /xyz to work >>>>>>>>>>> for it. I've tried adding >>>>>>>>>>> aliases="/abc=abc.war,/xyz=abc.war" and >>>>>>>>>>> aliases="/abc=abc,/xyz=abc" but neither of those >>>>>>>>>>> worked. This is how my original context.xml looked >>>>>>>>>>> like. >>>>>>>>>>> >>>>>>>>>>> <Context override="true" swallowOutput="true"> <!-- >>>>>>>>>>> Doing swallowOutput=true to allow each web >>>>>>>>>>> applications System.out and System.err calls to end >>>>>>>>>>> up in a separate log, not in catalina.out. See Jira >>>>>>>>>>> CA-4589 --> <!-- Default set of monitored resources >>>>>>>>>>> --> >>>>>>>>>>> <WatchedResource>WEB-INF/web.xml</WatchedResource> >>>>>>>>>>> <!-- Disable session persistence across Tomcat >>>>>>>>>>> restarts by including this line; no sessions used for >>>>>>>>>>> many OGC implemenations--> <Manager pathname="" /> >>>>>>>>>>> >>>>>>>>>>> <!-- Uncomment this to enable Comet connection >>>>>>>>>>> tacking (provides events on session expiration as >>>>>>>>>>> well as webapp lifecycle) --> <!-- <Valve >>>>>>>>>>> className="org.apache.catalina.valves.CometConnectionManagerVal > ve" >>>>>>>>>>> >>>>>>>>>>> >>>> >>>>>>>>>>> > /> --> >>>>>>>>>>> >>>>>>>>>>> </Context> >>>>>>>>>>> >>>>>>>> >>>>>>>> Tomcat 7 aliases are intended to map URLs within a single >>>>>>>> web application. You can't use it to duplicate the web >>>>>>>> application on two base paths. >>>>>>>> >>>>>>>> Here's what you need to do: >>>>>>>> >>>>>>>> 1. Put your WAR file in webapps/abc.war. This will deploy >>>>>>>> as usual. >>>>>>>> >>>>>>>> 2. Copy webapps/abc.war/META-INF/context.xml into >>>>>>>> conf/Catalina/localhost/xyz.xml and modify the <Context> >>>>>>>> element like this: >>>>>>>> >>>>>>>> <Context override="true" swallowOutput="true" >>>>>>>> docBase="webapps/abc.war "> ... </Context> >>>>>>> >>>>>>> Thanks Chris! I now get "Document base >>>>>>> /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist >>>>>>> or is not a readable directory" >>>> >>>> Is that path correct? What is the stack trace of that error? >>>> >>>> I would have expected the path to be pointing to abc.war, not >>>> .../xyz >>>> >>>> -chris What Chris is saying is the following: Suppose the user you're running Tomcat under is called tomcat, with a home directory of /home/tomcat. Make a directory under /home/tomcat - call it Apps (probably too generic, but you get the idea). Now copy abc.war into that directory. Then you'll create two context.xml files. Call one abc.xml Call the other xyz.xml In both abc.xml and xyz.xml, specify the complete path to abc.war as the docBase - like this (using the layout above) <Context docBase="/home/tomcat/Apps/abc.war"> <!-- any other stuff --> </Context> Now copy both of these xml files to $CATALINA_BASE/conf/Catalina/localhost/ More properly: $CATALINA_BASE/conf/[Engine name]/[Host name]/ where [Engine name] is the name attribute from the Engine element in server.xml, and Host name is the name attribute from the Host element in server.xml. I haven't tried this, but I don't see why it shouldn't work. The basis for this can be found here: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html . . . just my two cents (and no coffee) /mde/
signature.asc
Description: OpenPGP digital signature