Reputation: 4149
I have a java application. All I have with me is a set on class files. Iwant to replace one class file with a new one. Replacing the old class file with the new one and restrting tomcat is not reflecting the changes. How can I do this? I know its not a recommended way, but all I have is just one new class file.
Upvotes: 0
Views: 10016
Reputation: 8605
I've done this the way you describe before, and Tomcat reflected the changes just fine after restart.
Perhaps your application's files are in multiple locations, and you aren't replacing the class file in the correct deployment? Make sure if Tomcat is auto-expanding the WAR that you are replacing it in the expanded folder of files. If you app is deployed somewhere besides webapps
, double-check where your <Context>
is pointing to for its doc base.
Upvotes: 1
Reputation: 7296
You can configure Tomcat and make your webapp "reloadable". To do so, add reloadable=true
to the <Context>
element of your webapp.
Set to true
if you want Catalina to monitor classes in /WEB-INF/classes/
and /WEB-INF/lib
for changes, and automatically reload the web application if a change is detected. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.
Upvotes: 1