是否可以使用 IntelliJ 9 社区版在远程服务器上调试 GWT 客户端代码? [英] Is it possible to debug GWT client code on a REMOTE server using IntelliJ 9 Community Edition?

查看:10
本文介绍了是否可以使用 IntelliJ 9 社区版在远程服务器上调试 GWT 客户端代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我们的 Google Web Toolkit (GWT) 开发从 Eclipse 转移到 IntelliJ 9 社区版.到目前为止,我已经能够通过 GWT Maven 插件及其嵌入式 Jetty 容器成功运行和调试客户端/服务器代码.

I'm trying to move our Google Web Toolkit (GWT) development from Eclipse to IntelliJ 9 Community edition. So far I've been able to run and debug client/server code successfully via the GWT Maven plugin and its embedded Jetty container.

但是,当客户端代码已经在远程机器上运行时,我在调试客户端代码时遇到了麻烦(因此不需要嵌入式 Jetty 容器).

However, I'm having trouble debugging client code when it is already running on a remote machine (and hence there's no need for the embedded Jetty container).

有没有人成功地做到了这一点?任何帮助将不胜感激!

Has anyone been successful at achieving this? Any help would be appreciated!

更新:我终于能够做到这一点.请在下面查看我自己的答案...

UPDATE: I was finally able to accomplish this. Please see my own answer below...

推荐答案

我终于能够通过使用 GWT 的 DevMode 类,如文档.

I was finally able to accomplish this by using GWT's DevMode class, as described in the documentation.

简而言之——

  • 将您的项目添加到 IntelliJ 9 社区版
  • 添加应用程序运行/调试配置
  • 使用 com.google.gwt.dev.DevMode 作为您的主类(确保在项目类路径中包含 gwt-user 和 gwt-dev jar.请参阅 这里)
  • 添加以下程序参数:

  • Add your project to IntelliJ 9 Community edition
  • Add an Application run/debug configuration
  • Use com.google.gwt.dev.DevMode as your main class (make sure to include gwt-user and gwt-dev jars to the project classpath. See here)
  • Add the following program parameters:

-noserver -war "[爆炸战争的完整路径]" -gen "[生成文件的完整路径]" -logLevel INFO -port [远程服务器端口] -startupUrl "[URL远程页面]" [com.company.YourEntryPoint]

-noserver -war "[full path to your exploded war]" -gen "[full path to generated files]" -logLevel INFO -port [remote server port] -startupUrl "[URL of the remote page]" [com.company.YourEntryPoint]

这样,DevMode 运行器不会实例化内置容器,而是允许远程服务器的 JavaScript 以其原始 Java 形式进行调试.

This way, the DevMode runner will not instantiate the built in container and will allow your remote server's JavaScript to be debugged in its original Java form.

请注意,对于不需要调试远程客户端代码的构建,您可以使用 Maven 或 Ant 集成,这要简单得多.我对 webAppCreator 生成的 build.xml 没有任何经验,但是使用 Maven,您可以简单地使用以下参数运行 gwt:run 或 gwt:debug 目标:-DrunTarget=

Note that for builds that don't require debugging remote client code you may use Maven or Ant integration, which is much simpler. I don't have any experience with the webAppCreator generated build.xml, but with Maven you could simply run the gwt:run or gwt:debug goals with this parameter: -DrunTarget=

希望能帮到你!

这篇关于是否可以使用 IntelliJ 9 社区版在远程服务器上调试 GWT 客户端代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆