title: "Workspace is closed" exception when trying to get the workspace through ResourcesPlugin
body: <p>I get this error when trying to get the workspace through ResourcesPlugin:</p>
  
  <pre><code>java.lang.IllegalStateException: Workspace is closed.
  at org.eclipse.core.resources.ResourcesPlugin.getWorkspace(ResourcesPlugin.java:339)
  </code></pre>
  
  <p>The code generating this is:</p>
  
  <pre><code>IWorkspace ws = ResourcesPlugin.getWorkspace();
  </code></pre>
  
  <p>Can you please help with this problem?</p>