Is it possible to debug GWT client code on a REMOTE server using IntelliJ 9 Community Edition?

前端 未结 2 1089
Happy的楠姐
Happy的楠姐 2020-12-13 14:47

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 success

相关标签:
2条回答
  • 2020-12-13 15:19

    When running a GWT app deployed on a remote server, the client part of your app will have been translated into javascript so I do not think you will be able to debug this from IntelliJ. The server side part of your app will still be Java code. You should be able to start up this remote server with java debugging parameters (things like a transporttype and a port to listen to). From IntelliJ, you should be able to start up a remote debugging session using the same transporttype and port. If you look into remote debugging, you should be able to find how to do this.

    0 讨论(0)
  • 2020-12-13 15:23

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

    In short -

    • 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 "[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]

    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.

    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=

    Hope it helps!

    0 讨论(0)
提交回复
热议问题