top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Tomcat and Context.xml

+1 vote

I am using Tomcat version 7.0.40.

Whenever there is an entry to context.xml, the context.xml reloads and redeploys the webapps since it is configured that way and is required to be that way. When a user hits a URL at this point, the page will be blank since reloading is still underway. My concern is - is there a way to determine when the reload is complete? Also, is there a way to display a meaningful message when the user hits a page during reload?

posted Oct 18, 2013 by Majula Joshi

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Editing the context.xml triggers an undeploy followed by a deploy rather than a reload. Currently, the brief period between the undeploy and the deploy will be treated as if no web application exists.

Handling this the same way a context reload is handled (essentially pausing the request until the redeploy is complete) might be possible but that would require code changes. The problem is non-trivial because
of the interactions between the Mapper, the Host, the HostConfig and the Context objects that would need to be coordinated. I suspect the complexity would not be worth the benefit when there is a simpler solution available.

Using parallel deployment and deploying a new version would mean the new version is deployed without any downtime and the old version can be removed at your leisure.

answer Oct 18, 2013 by Sonu Jindal
IIRC there was a bug in the past that during a *reload*, the webapp was temporarily unavailable and the ROOT context would be used. I modified our deployment procedure (which typically deploys a single webapp to a single Tomcat instance) to also deploy a trivial ROOT webapp with "/*" mapped to a "temporarily unavailable" page.

Would such a strategy cover the case above?
Similar Questions
+1 vote

I'm using Apache Tomcat 6.0.24 and I've deployed a web application that defines its resources into META-INF/context.xml , especially information about connection pool

Sometimes I''ve to edit that file to change some data , i.e, database's JDBC url

I've seen that restart web application is not enough to apply these changes , so I need to redeploy the web application ( I mean, unpack WAR file, modify it , repack it again, copy to deploy folder ...)

Do you know other way to modify META-INF/context.xml and apply the changes and don't have to redeploy the WAR file? Restart the web application is not a problem, but restart Tomcat is?

0 votes

I am just wondering whether somehow I can use web.xml to point to the Tomcat JDBC Realm that I am using. Are those two completely disjoint or I can link them together.

+1 vote

I want to access the JNDI Directory context in Tomcat8. I've used DirContextURLStreamHandler class which was in Tomcat 7. But now that has been removed.

Can someone tell me how can I access the JNDI Directory Context in Tomcat 8?

+1 vote

We have a context that includes an underscore and that is unfortunately causing problems w/ a load balancer and cookie paths. Our URLs resemble this:

Where we have deployed a war file named "the_context.war".

I'd like to somehow alias the context name so both of these urls would effectively be the same:

Ideally this would be done w/o deploying the application twice. Is this possible in Tomcat 6 and/or 7 ?

0 votes

Has somebody of you ever tried to configure certificate mutual authentication between a MS IIS webserver and a Tomcat instance Does somebody know if this is even possible in IIS ?

I usually do it very well with Apache but this time I'm requested to put in front of Tomcat an IIS webserver.
Thanks in advance.

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.