解决:“Workbench has not been created yet” error in eclipse plugin programming”,OSGI启动控制台报错问题...

项目中使用了OSGI的框架,最近被问到OSGI框架是什么,自己表示几乎没什么认识,于是想自己手动搭建一个OSGI小例子试一试

于是在搭建过程中遇到了下面的问题:项目启动很慢而且控制台也报了很多异常出来,虽然最后也启动了

所以就想,如何去掉控制台的那些错误信息

Caused by: java.lang.IllegalStateException: Workbench has not been created yet.
    at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:93)
    at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.startup(LaunchingResourceManager.java:545)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.getLaunchingResourceManager(DebugUIPlugin.java:336)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.start(DebugUIPlugin.java:554)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:774)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:767)

 

查了相关的资料后有了以下的解决方案:

  1. Go to the Run configuration -> Remove all the target platform jars.
  2. Click on add required bundles.
  3. Check the org.apache.felix.gogo.runtime, org.apache.felix.gogo.shell, org.eclipse.equinox.console, org.eclipse.osgi and your jar file.
  4. The last and important step. Go to Setting-> check the checkbox of "Clear the configuration area before launching".
  5. Run the OSGi application now.
  6. Enjoy if it works for you as it worked for me.

按以上步骤操作设置后,问题得到解决,贴出来给大家共享

 

参考网址:https://stackoverflow.com/questions/13773582/workbench-has-not-been-created-yet-error-in-eclipse-plugin-programming

转载于:https://www.cnblogs.com/caogen1991/p/9258652.html

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值