aspose file tools*
The moose likes Tomcat and the fly likes avoid loading all applications under webapps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "avoid loading all applications under webapps" Watch "avoid loading all applications under webapps" New topic
Author

avoid loading all applications under webapps

Kriss Reddy
Ranch Hand

Joined: Mar 29, 2005
Posts: 54
Hello all,

I have a couple of applications under webapps folder and by default all applications are loaded/started when I start my tomcat. I would like to know how to load/start only applications that I want at any given time. Is there some configuration to be done to achieve this.

example:
/webapps/app1
/webapps/app2
/webapps/app3

I want to load any one or more app(x) at any given time.

Thanks in advance.
Kriss.


Kriss.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12825
    
    5
The Tomcat Web Application Manager lets you stop selected applications. I think that prevents them from loading when Tomcat is restarted, but have not tried it myself.
Bill
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You could set the autoDeploy attribute to false in your server.xml's Host section and then explicitly configure the apps that you want to run via context entries in server.xml (or the newer context fragment files in tomcat/conf/Catalina/localhost).

Stopping them from the manager app won't keep them from starting when Tomcat restarts.
Undeploy will keep them from starting but it does this by deleting the entire directory which is probably not what you would want.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Kriss Reddy
Ranch Hand

Joined: Mar 29, 2005
Posts: 54
Many thanks for your replies.

Ben, is there any documentation about what you mentioned in your reply.

Thanks,
Kriss.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Yes:
http://tomcat.apache.org/tomcat-5.5-doc/config/index.html

This is the page for the Host node.
http://tomcat.apache.org/tomcat-5.5-doc/config/host.html
Kriss Reddy
Ranch Hand

Joined: Mar 29, 2005
Posts: 54
Thanks for the links. Is this possible for 5.0.28 as well?
Kriss.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12825
    
    5
A crude but effective way of preventing Tomcat from loading an application would be to change the name of web.xml - without a web.xml on startup, Tomcat ignores the directory.
Bill
Bhoi Sandip
Greenhorn

Joined: Jun 02, 2011
Posts: 4
Hello experts,

I have similar problem but somewhat different I wanted my application not to deploy if it do not find some system property defined.
I am using WAS (Websphere Application Server). Though I am throwing SystemPropertyNotFoundException (which extends InternalError) from context initialized method of listener, it is getting catched by deployment manager (the Error should not be catched) attached screenshot for details. Please help me out n what could be wrong


[Thumbnail for ExceptionCaught.JPG]

zahir islam
Greenhorn

Joined: Dec 18, 2012
Posts: 1
i am using tomcat 6. I have updated server.xml file as below, but still all my applications are loading at each startup:

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="false"
xmlValidation="false" xmlNamespaceAware="false">

<Context path="/acbd" docBase="abcd" debug="0" reloadable="true"/>


<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>


</Host>


Am I missing anything?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: avoid loading all applications under webapps