【问题标题】:error Platform.getBundle("").start();错误 Platform.getBundle("").start();
【发布时间】:2012-02-21 00:21:48
【问题描述】:

我正在使用 RCP,并且我的应用程序类中有这个“启动”方法:

public class Application implements IApplication {
public Object start(IApplicationContext context) throws Exception {
    Display display = PlatformUI.createDisplay();

    try {
        // Enforcing that Spring Dynamic Modules extender is started
        Platform.getBundle("org.springframework.osgi.extender").start();  **//THIS IS LINE 26**
        int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
        if (returnCode == PlatformUI.RETURN_RESTART)
            return IApplication.EXIT_RESTART;
        else
            return IApplication.EXIT_OK;
    } finally {
        display.dispose();
    }

}
//More methods...
}

错误提示:

!SESSION 2012-01-27 21:59:11.417 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_29
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=es_ES
Framework arguments:  -product com.blackthorne.mvctest.product -d32
Command-line arguments:  -product com.blackthorne.mvctest.product -data /Users/Hepale/Documents/Java/Wisconsin - ET/Eclipse/MVCTest/../runtime-com.blackthorne.mvctest.product -dev file:/Users/Hepale/Documents/Java/Wisconsin - ET/Eclipse/MVCTest/.metadata/.plugins/org.eclipse.pde.core/com.blackthorne.mvctest.product/dev.properties -os macosx -ws cocoa -arch x86 -consoleLog -d32

!ENTRY org.eclipse.osgi 4 0 2012-01-27 21:59:12.168
!MESSAGE Application error
!STACK 1
java.lang.NullPointerException
    at com.blackthorne.mvctest.Application.start(Application.java:26)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
An error has occurred.

我相信它是 cos java 版本,但我在程序参数中添加了“-d32”(在运行配置中...) 我不知道缺少什么。

任何可以帮助我的人,我都非常感激,因为这真的是紧急情况。

我知道在这个程序员的世界里,我们需要分享我们的疑惑和知识。

提前致谢;)

【问题讨论】:

    标签: macos eclipse-rcp osgi bundle 32bit-64bit


    【解决方案1】:

    我会使用 OSGi 包的启动级别来确保包正确启动。您可以通过“配置”页面上的产品配置设置启动级别,也可以通过osgi.bundles 属性直接在config.ini 文件中设置启动级别。

    【讨论】:

      猜你喜欢
      • 2019-12-16
      • 1970-01-01
      • 2021-04-19
      • 2021-11-17
      • 2020-09-22
      • 2016-02-04
      • 1970-01-01
      • 1970-01-01
      • 2017-07-17
      相关资源
      最近更新 更多