2012-01-28 28 views
0

林RCP和我在我的應用程序類此「開始」方法:錯誤Platform.getBundle(「」)。start();使用

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 '到程序參數(在運行配置中...) 我不知道什麼是缺少的。

任何人都可以幫助我,我很欣賞,因爲這真的是一個緊急情況。

我知道在這個程序員的世界裏,我們需要分享我們的疑惑和知識。

在此先感謝;)

回答

1

我會使用的OSGi啓動級別捆綁,以確保捆正常啓動。您可以通過「配置」頁面上的產品配置來設置啓動級別,或者通過osgi.bundles屬性直接在config.ini文件中設置啓動級別。