[英]How To Debug Legacy GWT Code With Eclipse
我有一個棘手的問題。 我在遺留應用程序中有一些非常舊的 (1.7) GWT 代碼,我需要對其進行一些調試。 理想情況下,我只需將代碼更新為更現代的 GWT 版本,但有一堆自定義小部件使這變得困難。 因此,我需要想辦法找到可以按原樣處理代碼的工具。
經過大量的挖掘和反復試驗,當從命令行運行時,我能夠獲得“托管模式”來啟動和運行我的應用程序。 但是,當我嘗試在 eclipse 中做同樣的事情時,我遇到了問題。 開發 shell 啟動,但是當它嘗試打開瀏覽器時,它失敗並出現以下錯誤:
[ERROR] The browser widget class could not be instantiated
org.eclipse.swt.SWTError: XPCOM error -2147221164
at org.eclipse.swt.browser.Browser.error(Browser.java:1336)
at org.eclipse.swt.browser.Browser.<init>(Browser.java:236)
at com.google.gwt.dev.shell.BrowserWidget.<init>(BrowserWidget.java:242)
at com.google.gwt.dev.shell.moz.BrowserWidgetMoz.<init>(BrowserWidgetMoz.java:83)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.google.gwt.dev.shell.PlatformSpecific.createBrowserWidget(PlatformSpecific.java:53)
at com.google.gwt.dev.GWTShell.openNewBrowserWindow(GWTShell.java:504)
at com.google.gwt.dev.GWTShell.launchStartupUrls(GWTShell.java:465)
at com.google.gwt.dev.GWTShell.run(GWTShell.java:548)
at com.google.gwt.dev.GWTShell.main(GWTShell.java:321)
關於我在這里可能做錯的任何想法? 有沒有更好的選項來調試我的客戶端代碼?
我的環境: Ubuntu 18.04 (x64)
Eclispe 4.6 霓虹燈 (x86)
GWT 1.7
Java 7 (x86)
看起來 Eclipse 在運行其內部瀏覽器(XPCOM / Mozilla)時遇到問題。 您可以配置 Eclipse 來啟動外部瀏覽器嗎?
在最新版本的 Eclipse 中,您可以在Preferences -> General -> Web Browser
中,有“Use internal web browser”選項。 Select “使用外部 web 瀏覽器” 並檢查外部瀏覽器。
GXT 1.x functions by running a java application which wraps a native browser widget - on linux, this is an old version of firefox - something like firefox 3.5 or earlier.
If memory serves, this functions by having a different distribution per platform - for example, on linux at http://www.gwtproject.org/versions.html there is a download for 1.7 (1.7.1 is latest, at least of 1 .x 構建)。 請注意,該頁面上有 linux 下載的說明:
Linux 分發二進制文件僅適用於 x86 架構。 GWT 托管模式需要 32 位 JVM 和庫。 其他 32 位體系結構可以從源代碼構建,但不受支持,並且需要 Mozilla 1.7.12 的兼容構建。
你確定你滿足這些要求嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.