Tomcat 6.0.26缓存Java类

时间:2022-11-21 00:14:06

I am facing a wierd issue suddenly and I am out of wits why this would happen.

我突然面临一个奇怪的问题而且我不知道为什么会发生这种情况。

My basic setup is to use maven (eclipse plugin 0.20), Tomcat 6.0.26.

我的基本设置是使用maven(eclipse插件0.20),Tomcat 6.0.26。

Until few days back i was able to start tomcat in debug mode, make changes in code while debugging and test them. Then later run prepare-package for maven, stop and start tomcat to reflect the changes.

直到几天前我才能在调试模式下启动tomcat,在调试时对代码进行更改并测试它们。然后运行make-package for maven,停止并启动tomcat以反映更改。

But since couple of days, debug option stopped working and eclips was not loading the changes from the class correctly. I initially thought it to be a debug issue, but then even if I stopped tomcat, ran a prepare package and started tomcat, my class changes do not show up.

但是,由于几天后,调试选项停止工作,eclips没有正确加载类中的更改。我最初认为它是一个调试问题,但是即使我停止了tomcat,运行了一个prepare包并启动了tomcat,我的类更改也没有显示出来。

I normally keep build automatically true in eclipse which writes the class file to target/classes and maven copies it to WEB-INF/classes from where tomcat reads it. Toggling this option helped prepare-package to work only sometimes.

我通常在eclipse中保持构建自动为true,将类文件写入目标/类,maven将其复制到tomcat读取它的WEB-INF / classes。切换此选项有助于准备包有时只能工作。

I am not sure if this may be an issue with my maven-plugin or tomcat doing some wierd caching of classes. These are not servlet or JSPs but normal java classes.

我不确定这可能是我的maven-plugin或tomcat做一些奇怪的类缓存的问题。这些不是servlet或JSP,而是普通的java类。

Wanted to know if someone saw this kind of issue or is it just my machine giving me trouble

想知道是否有人看到这种问题,或者只是我的机器给我带来了麻烦

2 个解决方案

#1


0  

You could write a small web application, deploy it to tomcat from eclipse, debug it, modify the code and see if its auto deployed..It that works, you could try deleting your eclipse project and reimporting and rebuilding it

您可以编写一个小型Web应用程序,从eclipse将其部署到tomcat,调试它,修改代码并查看它是否自动部署。如果有效,您可以尝试删除您的eclipse项目并重新导入和重建它

#2


0  

This issue is resoved. my application had two jar(some content but different names only) having same class (same package hierarchy) with different versions. so when i was trying to debug, it was picking older one. i removed the older jar and problem is solved.

这个问题得到了解决。我的应用程序有两个jar(一些内容,但只有不同的名称)具有不同版本的相同类(相同的包层次结构)。所以当我试图调试时,它正在选择较旧的。我删除了旧罐子,问题解决了。

Thanks

#1


0  

You could write a small web application, deploy it to tomcat from eclipse, debug it, modify the code and see if its auto deployed..It that works, you could try deleting your eclipse project and reimporting and rebuilding it

您可以编写一个小型Web应用程序,从eclipse将其部署到tomcat,调试它,修改代码并查看它是否自动部署。如果有效,您可以尝试删除您的eclipse项目并重新导入和重建它

#2


0  

This issue is resoved. my application had two jar(some content but different names only) having same class (same package hierarchy) with different versions. so when i was trying to debug, it was picking older one. i removed the older jar and problem is solved.

这个问题得到了解决。我的应用程序有两个jar(一些内容,但只有不同的名称)具有不同版本的相同类(相同的包层次结构)。所以当我试图调试时,它正在选择较旧的。我删除了旧罐子,问题解决了。

Thanks