eclipse rcp 配制启动顺序后,打包后运行出错
项目中由于用到了spring来管理bean,会用到spring osgi服务,并且要对启动顺序做一些设置,在product文件的Configuration配制页面上“Start Levels”作了如下的设置:打开product文件用文本编辑器打开,配制如下:
<configurations>
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="4" />
<plugin id="org.springframework.osgi.extender" autoStart="true" startLevel="4" />
</configurations>
配制好后在 Overiew 中通过“Launch an Eclipse appliation”” 是可以正常启动的,但是通过“Eclipse Product export wizard ” 打包后,运行会出现下面的错误:
!SESSION 2012-02-10 18:57:27.812 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=zh_CN
Command-line arguments: -os win32 -ws win32 -arch x86
!ENTRY org.eclipse.osgi 4 0 2012-02-10 18:57:34.968
!MESSAGE Application error
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in "com.uaes.ucm" was unable to execute setInitializationData on an instance of "org.eclipse.springframework.util.SpringExtensionFactory".
at org.eclipse.core.internal.registry.ConfigurationElement.throwException(ConfigurationElement.java:62)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:257)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:191)
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:344)
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:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: java.lang.RuntimeException: application context for bundle com.uaes.ucm not found
at org.eclipse.springframework.util.SpringExtensionFactory.setInitializationData(SpringExtensionFactory.java:68)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:251)
... 13 more
这个错误是由于启动顺序没有配好才会出现的,也就说项目没有打包在eclipse中运行时,如果没有配制好启动顺序也会出现这种错误,但是我看了一下打包后生成的config.ini中已经生成配制顺序了。
有那位高手们遇到过这种情况没,在eclipse中配制好启动顺序后可以运行,但打包后却报错不能运行,或者有其它的方法可以打包成功的,谢谢大家了。
[解决办法]
start level 不是做这个滴 你是不是给我发过邮件?