Google Answers Logo
View Question
 
Q: Problem reloading expanded Java web app in Tomcat 5.0.3 ( No Answer,   0 Comments )
Question  
Subject: Problem reloading expanded Java web app in Tomcat 5.0.3
Category: Computers > Programming
Asked by: jazzbass-ga
List Price: $200.00
Posted: 06 Jul 2003 19:50 PDT
Expires: 08 Jul 2003 11:11 PDT
Question ID: 225896
I'm having a problem reloading a Java web application on Tomcat 5.0.3
on Windows 2000.

I'm developing a web application that needs to be deployed as an
expanded directory structure (the app contains Axis classes, which
need to write a file to the app's WEB-INF dir). I want to be be able
to change the Java classes and have Tomcat reload the updated classes
automatically.

I don't care what mechanism is used to deploy the app (war file that
Tomcat expands; directory I create by unjarring a war file, etc.) or
where the expanded directory resides, as long as the following are
true:
1. The deployment process can be done with Ant alone (no manual
intervention)
2. Any classes that were updated are reloaded automatically
3. Tomcat does not have to be restarted (although the app can be
stopped and started)

It seems that setting the app's "reloadable" context attribute would
do the trick, but I can't seem to convince Tomcat to respect the app's
reloadable setting.  So far I've tried many permutations of two basic
scenarios:

SCENARIO 1:
Set server's unpackWARs attribute to true and deploy app as war file.

I tried adding a context file (rainforest.xml, below) to the app's
META-INF. I also tried copying a context file to webapps before
deploying the war file. In both cases, Tomcat either ignores or
overwrites my context file with a new context file whose reloadable
attribute is false.

SCENARIO 2:
Deployed app as expanded directory

A. Initial deployment:
   1. copied rainservice.xml to webapps
   2. unjarred the war file into webapps/rainservice
B. After changing service implementation
   1. unjarred new war file into webapps/rainservice

Result: Application hangs - clients can't get socket connection to
app.

The Ant reload task gives errors in both cases. I tried to undeploy
and deploy the app using the Ant undeploy task but the undeploy also
gave errors in both cases (IncompatibleClassChangeError). However, I
can remove the app with the gui app manager.

autoDeploy and liveDeploy are both set to true for the Host. 

Here's the context file (rainservice.xml):

<Context className="org.apache.catalina.core.StandardContext" 
         cachingAllowed="true" 
         charsetMapperClass="org.apache.catalina.util.CharsetMapper" 
         configFile="webapps\rainservice.xml" 
         cookies="true" 
         crossContext="false" 
         debug="0" 
         docBase="C:\jwsdp\webapps\rainservice" 
         domain="Catalina" 
         engineName="Catalina" 
         j2EEApplication="none" 
         j2EEServer="none" 
         lazy="true" 
         mapperClass="org.apache.catalina.core.StandardContextMapper"
         path="/rainservice" 
         privileged="false" 
         reloadable="true" 
         startupTime="10" 
         swallowOutput="false" 
         tldScanTime="1151" 
         useNaming="true" 
         wrapperClass="org.apache.catalina.core.StandardWrapper"

Thanks,
Mike

Clarification of Question by jazzbass-ga on 07 Jul 2003 13:38 PDT
I also tried to remove the application with a "remove" request to the
Tomcat manager application so I could redeploy it. However, the
manager app can not delete the jar files in the WEB-INF directory (I
get a sharing violation when I try to delete the jar files manually),
and later deploy operations do not expand the WAR file. This happens
on Tomcat 4.1.24 and 5.0.3.

Clarification of Question by jazzbass-ga on 08 Jul 2003 11:11 PDT
I solved this problem by doing the following:
1. Using the Ant install task instead of deploy
2. Installing from a local directory, without specifying a context
descriptor (reloadable is false by default). When I set reloadable to
true, the application hung on restart
3. restarting the application with the stop and start tasks, instead
of the reload task (reload threw a IncompatibleClassChangeException)

Installed apps do not remain installed on a server restart, so I
deploy the app after testing.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy