how to reflect changes by replacing class files in tomcat?

别等时光非礼了梦想. 提交于 2019-12-23 06:01:21

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/7933640/how-to-reflect-changes-by-replacing-class-files-in-tomcat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!