[英]Whenever i edit in java file , i have to restart apache server for apply those changes in class file
Whenever I make any changes in java file, I have to restart server again and again for even small changes it. 每当我在java文件中进行任何更改时,我都必须一次又一次重新启动服务器,以进行很小的更改。 changes do not publish to server. 更改不会发布到服务器。
It is really time taken process. 这确实是耗时的过程。 how can I apply those changes in server without restarting server ? 如何在不重新启动服务器的情况下在服务器中应用这些更改?
I tried to auto publish while saving, but still it does not work. 我尝试在保存时自动发布,但仍然无法正常工作。
I think the most simple way to do this is to let your eclipse write the class files directly to the tomcat webapp class folder (ie $TOMCAT/webapps/YOUR_WEB_APPLICATION/WEB_INF/classes). 我认为最简单的方法是让日食将类文件直接写入tomcat webapp类文件夹(即$ TOMCAT / webapps / YOUR_WEB_APPLICATION / WEB_INF / classes)。 Then, allow tomcat to check if the class files have been updated, and reload them if they have. 然后,允许tomcat检查类文件是否已更新,如果有,请重新加载它们。
$TOMCAT_HOME/conf/context.xml
<Context reloadable="true">
<web-app reloadable="true"
>. 在您的应用程序web.xml文件中,并添加<web-app reloadable="true"
>。 Ideally for changes to get reflected you will have to restart the server. 理想情况下,为了反映更改,您将必须重新启动服务器。 The only way to get it done is to replace the specific class file by compiling the class, and manually replacing the class inside the war (assuming you have a Tomcat). 完成此任务的唯一方法是通过编译类来替换特定的类文件,并在战争中手动替换该类(假设您有Tomcat)。
In usual cases the above process will take almost the same time as deploying a new war/ear and having the server restarted. 在通常情况下,上述过程几乎与部署新的war / ear并重新启动服务器所需的时间相同。
PS: I would not personally recommend the above solution, since it's a hack and you may run into multiple problems when you do an actual build. PS:我个人不会推荐上述解决方案,因为这是一个hack,在进行实际构建时可能会遇到多个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.