【问题标题】:GWT not working in development modeGWT 在开发模式下不工作
【发布时间】:2014-11-28 12:18:28
【问题描述】:

我正在尝试运行使用 GWT 创建的项目。在 Intellij Idea 中,我创建了 GWT 配置类型的运行配置,如下所示:

  • 开发模式参数:

    -noserver -bindAddress 127.0.0.1 -codeServerPort 9997 -war D:\projects\greensoft\trunk\out\artifacts\sd_extern_war_exploded

  • 服务器:默认

当我开始打印时:

Connected to the target VM, address: '127.0.0.1:60552', transport: 'socket'
Nov 28, 2014 12:45:31 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Dev Mode initialized. Startup URLs: 
http://127.0.0.1:8888/chestionar.html?gwt.codesvr=127.0.0.1:9997
http://127.0.0.1:8888/index.html?gwt.codesvr=127.0.0.1:9997

但是当我启动服务器时,这个 url 不起作用:

http://localhost:8080/sd-extern/chestionar.html?gwt.codesvr=127.0.0.1:9997

出现错误提示:

Plugin failed to connect to Development Mode server at 127.0.0.1:9997

有什么想法吗?

谢谢你, 泰金。

【问题讨论】:

  • 您似乎在使用外部服务器。你试过吗:127.0.0.1:8888/chestionar.html?gwt.codesvr=127.0.0.1:9997?这行得通吗?
  • 不,它没有。知道为什么我启动 GWT 配置时该链接会出现在控制台中吗?
  • @TekinOmer 要么您实际上并没有在 -noserver 模式下运行,要么您只需要传递 -startupUrl http://localhost:8080/sd-extern/chestionar.html 以便它输出与您在浏览器中打开的相同的 URL(并且您然后可以只要求 GWT DevMode 打开它)
  • @ThomasBroyer 我添加了 -startupUrl。现在该 url 出现在控制台中,但服务器仍然无法连接到它。

标签: java gwt intellij-idea


【解决方案1】:

您还应该看到指向https://code.google.com/p/google-web-toolkit/wiki/TroubleshootingOOPHM的链接

也许只是尝试使用http://127.0.0.1:8080 而不是http://localhost:8080

【讨论】:

  • 图标是红色的,当我点击它时,它说:“允许网络和代码服务器(127.0.0.1/127.0.0.1)使用插件”。使用 127.0.0.1 代替 localhost 也不起作用。
  • 然后可能会仔细检查您的防火墙设置;也许 Windows 正在阻止端口 9997 上的连接。
【解决方案2】:

也许您没有为您的 IntelliJ 模块添加 Web Facet。您可以在“项目结构”对话框的“模块”选项卡中看到它。模块下应该有 GWT facet 和 Web facet。

【讨论】:

    【解决方案3】:

    感谢您的回答。我终于找到了问题:应用程序使用了另一个应用程序,它也有一个 GWT 方面(我没有在 Idea 中创建)。 我没想到要提到有多个模块的事实,所以我猜是我的错:)

    【讨论】:

      猜你喜欢
      • 2019-07-05
      • 1970-01-01
      • 2018-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-29
      相关资源
      最近更新 更多