title: How do I upgrade this embedded tomcat?
body: <p>I want to basically upgrade my tomcat version(on RHEL).</p>
  
  <p>Always worked in an environment where my <code>war</code> file would be dumped into */webapps, on restart of tomcat, the <code>war</code> file would expand and the rest is history.</p>
  
  <p>Now, the system I'm working on, has completely different folder structure.</p>
  
  <p>Something like this:</p>
  
  <pre><code>[root@bliss ~]# ls /usr/local/blah/blu-app/WEB-INF/
  accounts      faces-reports.xml  logging.properties             web-app_2_3.dtd
  bin           faces-syscfg.xml   logging.properties-production  web-app_2_4.xsd
  buildnum.txt  framework2007      perl                           web.xml
  classes       host.xsd           settings                       work
  deploy-root   java.policy        tags
  events.xsd    lib                tld
  [root@bliss ~]#
  </code></pre>
  
  <p>I can see some tomcat related jars here:</p>
  
  <pre><code>/usr/local/blah/blu-app/WEB-INF/lib/tomcat-http.jar
  /usr/local/blah/blu-app/WEB-INF/lib/tomcat-util.jar
  /usr/local/blah/blu-app/WEB-INF/lib/tomcat-coyote.jar
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>So I did find out that the tomcat is embedded 'cuz I found the following code starting it:</p>
  
  <pre><code>tomcat = new Embedded();
  tomcat.setCatalinaHome(targetPath);
  
  Host host = tomcat.createHost("localhost", targetPath);
  Context rootCtx = tomcat.createContext("", targetPath);
  ((StandardContext)rootCtx).setWorkDir("WEB-INF/work"); 
  ServletContext servletContext = rootCtx.getServletContext();
  servletContext.setAttribute("version", version);
  ApplRealm realm = new ApplRealm(servletContext);
  tomcat.setRealm(realm);
  
  rootCtx.setPrivileged(true);
  
  Engine engine = tomcat.createEngine();
  engine.setName("tomcat");
  engine.setDefaultHost("localhost");
  host.addChild(rootCtx);
  engine.addChild(host);
  tomcat.addEngine(engine);
  
  LOG.debug("starting tomcat");
  tomcat.start();
  LOG.debug("tomcat started");
  // clear out any old sessions: see bug 17882
  Session[] sessions = rootCtx.getManager().findSessions();
  for (int i = 0; i &lt; sessions.length; i++)
  {
      sessions[i].expire();
  }
  
  ServerSocket socket = null;
  socket = new ServerSocket(CmcUtils.getControlPort(), 2, InetAddress.getByName("127.0.0.1"));
  socket.accept();
  
  LOG.info("Received shutdown command. Exiting !");
  
  tomcat.stop();
  </code></pre>
  
  <p>The question then is, how do I upgrade this tomcat to say Tomcat6?</p>
  
  <p>Replace with the latest jars in WEB-INF/lib? Which all jars?</p>