Hi all. I've been racking my brain on this for a good day and wanted to get some help. I have a tomcat 5.0.28 installation. I used the manager app to install my application. My application has a context.xml file. Here is what the context tag looks like inside of that:
I then shutdown tomcat and restarted it. Now when I open the manager app, I see that there are two context entries listed: one for "/software/data/myportal" AND one for "portal".
Let me give some other useful info: the war file I uploaded is named portal.war. When it gets unpacked by tomcat, it creates a directory called webapps/portal
In server.xml I have autoloading off. Here is what that looks like: <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false"/>
Can someone help me figure out how to get it so it doesn't deploy two context's for the same app? I'd really appreciate it!
Thanks. I also want to mention that for a test I deleted portal.jar from the webapps folder, thereby just leaving the unpacked portal folder inside of webapps. I then stopped and started tomcat and it still deployed two context's.
Have you tried without the docBase attribute in your Context file?
Joined: Feb 19, 2006
Yes. When I take out the docbase, it actually has a problem starting up the "/software/data/myportal" context, but starts the /portal context ok. When I change the docBase back to docBase="portal", it works again.
Joined: Feb 19, 2006
I may have an uneducated guess here. When tomcat starts up it probably first checks to see what's in the webapps folder. It probably sees the "portal" folder unpacked there and deploys that under the context "/portal". THEN it probably sees that there is a portal.xml file in the conf/catalina/localhost folder and it does what that says - deploy into context "/software/data/myportal" with the docbase in /webapps/portal. So it effectively deploys the same app twice into two different contexts'. This is just what appears to be happening.
I bet if the app in the webapps folder was named "/software/data/myportal" (which obviously isn't a valid name for a folder), that it maybe would only deploy one time? Another thing that might help this is to completely move the portal app out of the webapps directory. Maybe that would work.
I still want to know if it's possible to configure this the way I have it without two context being created.
subject: Why is it deploying in two contexts? I'm stumped