【问题标题】:create swt.browser of mozilla with xulrunner occurs error使用 xulrunner 创建 Mozilla 的 swt.browser 发生错误
【发布时间】:2013-02-26 15:12:17
【问题描述】:

我使用mozilla的org.eclipse.swt.browser和xulrunner来加载网页内容,但是我得到了错误:
Unhandled event loop exception XPCOM error -2147467261
我的开发环境:
操作系统:win7 * 32bit
Eclipse : 3.7.2 * 32bit
SWT:32 位
xulrunner:发布 18.0
像这样的代码:

//register xulrunner path
static{
     System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "F:/soft/xulrunner18/xulrunner"); 
   }
...

//create Mozilla browser
browser = new Browser(parent, SWT.MOZILLA);  //error was caused here.

谁知道原因,或者告诉我如何找到原因?
非常感谢

【问题讨论】:

    标签: eclipse-plugin swt mozilla xulrunner jgraph


    【解决方案1】:

    显然,SWT.Browser 不适用于 Xulrunner 17+。

    您可以在此处获取版本 10esr 的独立副本:http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/10.0.4esr/runtimes/

    然后您需要在运行配置参数中指定 xulrunner 路径: -Dorg.eclipse.swt.browser.XULRunnerPath=C:\path\to\xulrunner\

    【讨论】:

    • @user2116583 感谢 user2116583。经测试,xulrunner-3.6.28-可以正常工作,高版本会导致XPCOM错误。但是,奇怪的是,xulrunner3.6.28无法加载需要firefox 3+的mxGragh(draw.io)测试网页内容,因为 Xulrunner3.6.28 匹配 firefox3.6.AnyBody 知道为什么?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-10
    相关资源
    最近更新 更多