Server is not loading/compiling the latest version of code in Eclipse?

不问归期 提交于 2019-12-12 04:02:23

问题


A few days back, while the built-in server (Tomcat v5.5) in eclipse was running, and while I was modifying the code, the server used to recompile and restart itself. I've gotten into a problem from the last day, where, the server DOESN'T load the LATEST version of the code I'm writing, instead, (I'm assuming) it compiles its own internal cache. Yesterday evening, I fixed that problem by (as I can remember) by clearing some cache or something. But, I did the same today, and its malfunctioning in both ways -- by not compiling the latest version and -- not auto restarting when I modify the code. I've even tried restarting eclipse but the server is still compiling its own code which CAN'T be seen in the workspace.

[EDIT]

I've now resolved the problem which was with something with importing the right add-on library to the working directory.


回答1:


While the embedded Tomcat in Eclipse should recompile the classes/JSP:s/whatever it falls victim of its own caching which causes it to load old versions of the classes after reloading. So yes, the new classes actually exist in the embedded Tomcat but since the cache isn't cleaned properly (or maybe not at all) it won't reload classes automatically and thus has to be restarted every single time you've made a change.

Additionally it seems that there's some bugs in the Eclipse Server controller which causes the auto-reloading to just stop working at times. Basically it's a bit of a mess and all you can do is to restart it continuously. Or use Jetty which is a lot faster to use when developing.




回答2:


Use Jetty instead?




回答3:


I have occasionally found that Eclipse gets confused about something, and frequently the easiest way is just to dump the current Eclipse tree, and unpack a new one, in which you rebuild your workspace.

We use projectSet.psf's in our source repository which makes the above process something that can be done in about a minute.



来源:https://stackoverflow.com/questions/1653684/server-is-not-loading-compiling-the-latest-version-of-code-in-eclipse

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