带有 SWT.Browser 和 XULRunner 的 RCP

发布于 2024-12-12 00:04:13 字数 880 浏览 0 评论 0原文

我正在使用 SWT.Browser (SWT.MOZILLA) 开发 RCP 应用程序 (Windows):

Browser browser = new Browser(parent, SWT.MOZILLA);

它可以与旧的 XULRunner 3.6.23 和描述的安装一起正常工作 此处

xulrunner.exe --register-global

我想要使用新的 XULRunner 8.x,但如此处 安装 XULRunner 的方式已被删除。

因此,我以编程方式添加了 XULRunner-Path:

System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "Path\\To\\xulrunner_8.x"); 

但是当我启动应用程序时,我会收到以下错误

org.eclipse.swt.SWTError: XPCOM error -2147467261

那么将 XULRunner 8.x 与 RCP 应用程序嵌入并避免此错误的首选方法是什么?

I'm developing an RCP application (Windows) with SWT.Browser (SWT.MOZILLA):

Browser browser = new Browser(parent, SWT.MOZILLA);

It's working fine with the old XULRunner 3.6.23 and the installation described here:

xulrunner.exe --register-global

I want to use the new XULRunner 8.x, but as mentioned here the old way to install XULRunner was removed.

So I added the XULRunner-Path programmatically:

System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "Path\\To\\xulrunner_8.x"); 

But when I start my application, I'll get the following error

org.eclipse.swt.SWTError: XPCOM error -2147467261

So what's the preferred way to embed XULRunner 8.x with an RCP application and avoiding this error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

山川志 2024-12-19 00:04:13

Eclipse 3.8 / 4.2 M6 开始org.eclipse.swt.browser 现在支持嵌入 XULRunner 10.0.x,但您必须提供 XULRunner 10 运行时并明确指向它,如常见问题解答中所述:

...    
    System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "path\to\xulrunner_10"); 
...

XULRunner 10 运行时可以从 <一个href="http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/10.0/runtimes">ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/10.0/runtimes/

JavaXPCOM

Mozilla 不再维护 JavaXPCOM,但作为 格兰特·盖伊德说

浏览器不需要 JavaXPCOM 即可工作,它只是公开
想要通过其 getWebBrowser() 方法自行使用它的应用程序。

Linux XULRunner 10 目前无法在 Linux 下运行。

由于 Mozilla bug 720682

As of Eclipse 3.8 / 4.2 M6 the org.eclipse.swt.browser now supports embedding XULRunner 10.0.x, but you must ship a XULRunner 10 runtime and explicitly point at it as described in the FAQ:

...    
    System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "path\to\xulrunner_10"); 
...

The XULRunner 10 runtime can be downloaded from ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/10.0/runtimes/

JavaXPCOM

Mozilla is not maintaining JavaXPCOM anymore, but as Grant Gayed says:

The Browser does not require JavaXPCOM in order for it to work, it just exposes
it to apps that want to use it themselves through its getWebBrowser() method.

Linux

XULRunner 10 will currently not run under Linux because of Mozilla bug 720682.

何时共饮酒 2024-12-19 00:04:13

对于 Windows,您还可以使用 Internet-Explorer 作为浏览器,直到 eclipse 正确支持 xulrunner(将在 4.3.x 版本中)。

对于 IE:

指定即可

    -Dorg.eclipse.swt.browser.DefaultType=ie,mozilla

只需在 eclipse.ini 中

。您可以在此处阅读更多相关信息。

For Windows you can also use the Internet-Explorer as browser until eclipse supports xulrunner correctly (will be in a 4.3.x version).

For IE:

just specify

    -Dorg.eclipse.swt.browser.DefaultType=ie,mozilla

at the eclipse.ini.

You can read more about it here.

楠木可依 2024-12-19 00:04:13

我在 windows7(64 位)上运行并拥有新的 xulrunner vresion:31.0.0 ([http://wiki.mozilla-x86-64.com/Download][1]

但是当我尝试给出路径时它给了我错误
System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "path\to\xulrunner_31\");

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.processCommandResult(MessagingInterface.java:342)
    at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.syncSend(MessagingInterface.java:329)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.syncSend_(SWTNativeInterface.java:392)
    at chrriis.dj.nativeswing.swtimpl.NativeInterface.syncSend(NativeInterface.java:104)
    at chrriis.dj.nativeswing.swtimpl.Message.syncSend(Message.java:64)
    at chrriis.dj.nativeswing.swtimpl.CommandMessage.syncExec(CommandMessage.java:55)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent.runSync(SWTNativeComponent.java:201)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent.createNativePeer(SWTNativeComponent.java:1009)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent.access$17(SWTNativeComponent.java:989)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent$12.run(SWTNativeComponent.java:882)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:738)
    at java.awt.EventQueue.access$300(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:699)
    at java.awt.EventQueue$3.run(EventQueue.java:697)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:708)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent$CMN_createControl.run(SWTNativeComponent.java:663)
    at chrriis.dj.nativeswing.swtimpl.CommandMessage.runCommand(CommandMessage.java:61)
    at chrriis.dj.nativeswing.swtimpl.NativeInterface.runMessageCommand(NativeInterface.java:172)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.runMessageCommand(SWTNativeInterface.java:1429)
    at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.runMessage(MessagingInterface.java:121)
    at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.processReceivedMessages(MessagingInterface.java:106)
    at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.access$2(MessagingInterface.java:94)
    at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface$2$2.run(MessagingInterface.java:442)
    at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface$OutProcess.runNativeSide(SWTNativeInterface.java:1352)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.main_(SWTNativeInterface.java:1461)
    at chrriis.dj.nativeswing.swtimpl.NativeInterface.main(NativeInterface.java:224)
Caused by: org.eclipse.swt.SWTError: XPCOM error 0x80004005
    at org.eclipse.swt.browser.Mozilla.error(Unknown Source)
    at org.eclipse.swt.browser.Mozilla.initXULRunner(Unknown Source)
    at org.eclipse.swt.browser.Mozilla.create(Unknown Source)
    at org.eclipse.swt.browser.Browser.<init>(Unknown Source)
    at chrriis.dj.nativeswing.swtimpl.components.core.NativeWebBrowser.createControl(NativeWebBrowser.java:431)
    ... 19 more

如果没有它,它会显示 IE 9.0 或另一个 xulunner,我不确定从哪里得到它工作正常,但显示 firefox 版本 5.0。知道如何更新最新的 Firefox 版本吗?

I am running on windows7(64 bit) and have new xulrunner vresion:31.0.0 ([http://wiki.mozilla-x86-64.com/Download][1])

But when i try to give a path it given me error
System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "path\to\xulrunner_31\");

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.processCommandResult(MessagingInterface.java:342)
    at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.syncSend(MessagingInterface.java:329)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.syncSend_(SWTNativeInterface.java:392)
    at chrriis.dj.nativeswing.swtimpl.NativeInterface.syncSend(NativeInterface.java:104)
    at chrriis.dj.nativeswing.swtimpl.Message.syncSend(Message.java:64)
    at chrriis.dj.nativeswing.swtimpl.CommandMessage.syncExec(CommandMessage.java:55)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent.runSync(SWTNativeComponent.java:201)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent.createNativePeer(SWTNativeComponent.java:1009)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent.access$17(SWTNativeComponent.java:989)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent$12.run(SWTNativeComponent.java:882)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:738)
    at java.awt.EventQueue.access$300(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:699)
    at java.awt.EventQueue$3.run(EventQueue.java:697)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:708)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent$CMN_createControl.run(SWTNativeComponent.java:663)
    at chrriis.dj.nativeswing.swtimpl.CommandMessage.runCommand(CommandMessage.java:61)
    at chrriis.dj.nativeswing.swtimpl.NativeInterface.runMessageCommand(NativeInterface.java:172)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.runMessageCommand(SWTNativeInterface.java:1429)
    at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.runMessage(MessagingInterface.java:121)
    at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.processReceivedMessages(MessagingInterface.java:106)
    at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.access$2(MessagingInterface.java:94)
    at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface$2$2.run(MessagingInterface.java:442)
    at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface$OutProcess.runNativeSide(SWTNativeInterface.java:1352)
    at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.main_(SWTNativeInterface.java:1461)
    at chrriis.dj.nativeswing.swtimpl.NativeInterface.main(NativeInterface.java:224)
Caused by: org.eclipse.swt.SWTError: XPCOM error 0x80004005
    at org.eclipse.swt.browser.Mozilla.error(Unknown Source)
    at org.eclipse.swt.browser.Mozilla.initXULRunner(Unknown Source)
    at org.eclipse.swt.browser.Mozilla.create(Unknown Source)
    at org.eclipse.swt.browser.Browser.<init>(Unknown Source)
    at chrriis.dj.nativeswing.swtimpl.components.core.NativeWebBrowser.createControl(NativeWebBrowser.java:431)
    ... 19 more

Without that it showing IE 9.0 or with another xulunner which i not confirm from where get this is working fine but showing firefox version 5.0. Any idea how i can update with latest firefox version.

一生独一 2024-12-19 00:04:13

Eclipse_4.4.2现在支持XULRunner24.0,你可以尝试这个版本。

Eclipse_4.4.2 now supports XULRunner24.0, you can try this version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文