Error "Workbench has not yet been" Error in programming eclipse plugins

With the launch of my eclipse plugin, I got a Root exception:java.lang.IllegalStateException: Workbench has not been created yet. error Root exception:java.lang.IllegalStateException: Workbench has not been created yet. .

And it seems like a side effect is causing a packet exception error. I do not think my code uses the egit module.

 org.osgi.framework.BundleException: Exception in org.eclipse.egit.ui.Activator.start() of bundle org.eclipse.egit.ui. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300) 

How to remove this error? This is code that accesses the workspace. I found this article - Debugging an Eclipse failed launch , stating that this is a race condition, but I'm not sure why I have a race condition, and if so, how to remove it,

 public void renameClassRefactor() throws CoreException { // get the project information with ResourcesPlugin IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); // 1. The name of the project in the workspace System.out.println(ResourcesPlugin.getWorkspace().toString()); java.io.File workspaceDirectory = root.getLocation().toFile(); System.out.println(workspaceDirectory.toString()); 
+8
eclipse plugins workspace
source share
2 answers

Referring to this site , I can add the -clean to Run Configuration to remove the error message.

enter image description here

+12
source share

I fought a lot for the fact that the "Workbench has not yet been created" in full day.

But I got the solution by following these steps.

  • Go to Run Configuration β†’ Remove all containers of the target platform.
  • Click to add the required packages.
  • Check org.apache.felix.gogo.runtime , org.apache.felix.gogo.shell , org.eclipse.equinox.console , org.eclipse.osgi and your jar file.
  • The last and important step. Go to Settings, check the box " Clear configuration area before starting ."
  • Launch the OSGi app.
  • Enjoy if this works for you, as it worked for me.

thanks

+17
source share

All Articles