0

我在 Tomcat 上运行的核心应用程序正在部署 webapps 本身。它从部署位置获取战争,进行一些处理并将其扩展到 webapps 目录,然后 tomcat 完成其余的工作......

我只需要 Eclipse WTP 来处理 JVM 的 hotswap / jdwp ...所以我决定尝试一下。但我不知道该怎么做。WTP 只是将目标目录复制到 webapps 中。

编辑:这是一个 Maven 项目,支持 m2eclipse wtp

4

2 回答 2

0

我不确定我是否完全理解您的问题,但如果您希望 tomcat 不扩展unpackWAR=falsecontext.xml

于 2011-04-21T22:09:15.803 回答
0

我只需要 Eclipse WTP 来处理 JVM 的 hotswap / jdwp

无论如何,jdwp 或热代码替换都可以正常工作。它在 WTP 和远程调试设置中工作 - “catalina.sh jpda run”并连接到它。

是否可以设置 Eclipse WTP 来部署 WAR 而不是复制目标目录?

我认为开箱即用是不可能的。

你也可以这样做:

In Eclipse, open the "Run Configurations" manager (Run -> Run Configurations...)
On the "Java Application" node, right click and choose "New".
On the first tab (Main) select the project you are running in tomcat
In the Main Class field enter org.apache.catalina.startup.Bootstrap
On the Arguments tab, in the Program Arguments field enter start
In the VM arguments field enter the following:

-Xms1024m 
-Xmx1024m
-XX:PermSize=128m 
-XX:MaxPermSize=256m
-XX:+CMSClassUnloadingEnabled 
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=true
-Dcatalina.base=/bundles/tomcat-6.0.x
-Dcatalina.home=/bundles/tomcat-6.0.x 
-Djava.io.tmpdir=/bundles/tomcat-6.0.x/temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=/bundles/tomcat-6.0.x/conf/logging.properties

您可能还注意到我包含了 tomcat 的 juli 日志管理器,这样所有正常的 Web 应用程序配置都可以按预期工作并在 Eclipse 控制台中运行,这也非常好。

在工作目录字段中选择“其他”并输入 /bundles/tomcat-6.0.x/bin。

在 Classpath 选项卡上,删除 User Entries 下的所有条目,然后选择“Add External JARs...”。选择位于 /bundles/tomcat-6.0.x/bin 中的 3 个 jar。

在 Source 选项卡上,确保您同时拥有 Default 以及列表中的项目。

您可以选择在这里添加您正在处理的任何插件项目,以及添加到 jsp java 类的路径(通常是 /bundles/tomcat-6.0.x/work/Catalina/localhost/_)

在通用标签上,至少选择“在收藏夹菜单中显示”下的“调试和运行”。

于 2011-04-22T07:37:49.113 回答