Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6618185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:47:51+00:00 2026-05-25T20:47:51+00:00

I deploy a application to tomcat with context xml. I want the tomcat work

  • 0

I deploy a application to tomcat with context xml. I want the tomcat work at debug mode, I means if I change something inside a function, like change
String a=”123″;
to
String a=”456″;
tomcat should get the change without reload the application.

The web01.xml under %CATALINA_HOME%/conf/Catalina/localhost

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="d:/document/workspace3.6/web01/WebContent" path="/web01" reloadable="false" debug="1" ></Context>

but now tomcat didn’t worked as I expected, if I replace the old class file with new version, I must restart tomcat to get the change.

Why tomcat didn’t reload the class,How should I do to let it work as debug mode?

I am not use Eclipse now. and I don’t want to set reloadable=”true”, this will reload the entire application if class changed.

I used tomcat5.5.23

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:47:52+00:00Added an answer on May 25, 2026 at 8:47 pm

    Ok, here’s an actual example:

    I have the cnas-war maven project. Once I build it with Maven, I get the following directory:

    c:/_andrei/work/cnas/cnas-war/target\cnas-war-0.0.1-SNAPSHOT
    

    In here I have all the stuff that normally would get packaged in the .war file, like .class files, .jsp files, .jar files etc. Effectively it’s the .war file exploded.

    I also have a Tomcat 5.5 specifically tailored for the deployment of this war, cleverly placed in the tomcat_cnas folder. In the Tomcat config file (conf\server.xml) I have the following:

        <?xml version="1.0" encoding="utf-8"?>
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
         parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
         which may contain one or more "Service" instances.  The Server
         listens for a shutdown command on the indicated port.
    
         Note:  A "Server" is not itself a "Container", so you may not
         define subcomponents such as "Valves" or "Loggers" at this level.
     -->
    <Server port="8125" shutdown="SHUTDOWN">
      <!-- Comment these entries out to disable JMX MBeans support used for the 
           administration web application 
      <Listener className="org.apache.catalina.core.AprLifecycleListener" />
      <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/> -->
      <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
      <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
      <!-- Global JNDI resources -->
      <GlobalNamingResources>
        <!-- Test entry for demonstration purposes -->
        <Environment name="simpleValue" type="java.lang.Integer"
        value="30" />
        <Resource auth="Container"
        configurationDirectory="c:/cnas-content"
        factory="com.genia.toolbox.web.jndi_config.StringContainerFactory"
        name="string/activitymanagerConfigurationContainer"
        type="com.genia.toolbox.web.jndi_config.StringContainer" />
        <Resource name="string/activitymanagerConfigurationContainer"
        auth="Container"
        type="com.genia.toolbox.web.jndi_config.StringContainer"
        factory="com.genia.toolbox.web.jndi_config.StringContainerFactory"
        configurationDirectory="c:/cnas-content" />
      </GlobalNamingResources>
      <!-- Define the Tomcat Stand-Alone Service -->
      <Service name="Catalina">
        <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
        <Connector acceptCount="100" connectionTimeout="20000"
        disableUploadTimeout="true" enableLookups="false"
        maxHttpHeaderSize="8192" maxSpareThreads="75" maxThreads="150"
        minSpareThreads="25" port="8081" redirectPort="8443" />
        <!-- Define the top level container in our container hierarchy -->
        <Engine defaultHost="localhost" name="Catalina">
          <!-- for activitymanager -->
          <Host name="localhost" appBase="webapps" unpackWARs="true"
          autoDeploy="true" xmlValidation="false"
          xmlNamespaceAware="false">
            <Context path="/cnas"
            docBase="c:/_andrei/work/cnas/cnas-war/target/cnas-war-0.0.1-SNAPSHOT/"
            workDir="c:/_andrei/work/cnas/cnas-war/target/work-cnas/">
              <ResourceLink name="string/configurationContainer"
              global="string/activitymanagerConfigurationContainer"
              type="com.genia.toolbox.web.jndi_config.StringContainer" />
              <Resource name="bean/cnasConfig" auth="Container"
              type="com.genia.toolbox.projects.cnas.war.config.CnasConfig"
              factory="org.apache.naming.factory.BeanFactory"
              classpath="false" fileSystem="true"
              applicationFileLocation="c:/cnas-content/application.properties" />
              <Resource name="bean/cnasApplicationData"
              auth="Container"
              type="com.genia.toolbox.projects.cnas.war.config.CnasConfig"
              factory="org.apache.naming.factory.BeanFactory"
              classpath="false" fileSystem="true"
              applicationFileLocation="c:/cnas-content/cnas_application_data.xml" />
            </Context>
            <!--Context docBase="C:/travail/workspace/cnas/cnas-ws-proxy/target/webapp" path="/proxy">
    
                    <Resource name="bean/params" 
                        auth="Container"
                        type="fr.genia.cnas.config.Parameters" 
                        factory="org.apache.naming.factory.BeanFactory"
                        log4jFile="" 
                        serviceUrl="" 
                        debugMode="true" >
    
                    </Resource>
    
                </Context-->
          </Host>
        </Engine>
      </Service>
    </Server>
    

    As you can see, in the “context” tag I have a docBase property pointing to the snapshot directory (the one where the war is exploded after maven builds it). Now, with this setup, and having this project imported into Eclipse, if I do a maven build, and then start this Tomcat, the war will be deployed and running. At this point, if I modify the content of a method in a .java file inside Eclipse (and save), then that code will be automatically taken into account by Tomcat and the application will behave differently, without any extra re-deployment. Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application (WAR) that I want to deploy in Tomcat 5.
I'm searching for something that can deploy on an application server (tomcat) a war
I have to to deploy a Ruby on Rails application to an tomcat application
I create a web application (WAR) and deploy it on Tomcat. In the webapp
Hitting debug will deploy the application to \program files\AppNamespace\AppName.exe and attach to it. However,
I am trying to deploy a WAR on the mentioned tomcat application server. However
I'm trying to deploy a JSF based application to Tomcat 6. The way my
I want to be able to deploy code changes to Tomcat (near instantly), while
I have a Java application running on Tomcat 7. I want my application to
I'm trying to deploy new web application in Tomcat 6.0, but whenever I click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.