title: The Activator X for bundle Y is invalid, caused by ClassNotFoundException: X
body: <p>When starting my OSGi application in eclipse, I get the following error:</p>
  
  <pre><code>org.osgi.framework.BundleException: The activator org.pathvisio.sbgn.SbgnPlugin for bundle org.pathvisio.sbgn is invalid
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:157)
      at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:751)
      at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:370)
      at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1068)
      at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:557)
      at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:464)
      at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:248)
      at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:445)
      at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
      at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)
  Caused by: java.lang.ClassNotFoundException: org.pathvisio.sbgn.SbgnPlugin
      at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)
      at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
      at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)
      at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
      at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:326)
      at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:231)
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:150)
      ... 10 more
  </code></pre>
  
  <p>This seems to be the same problem as:
  <a href="https://stackoverflow.com/questions/1305307/the-activator-bundle-is-invalid">The activator for bundle is invalid</a></p>
  
  <p>However, no matter what I try, I keep getting that same error. Even if I change the name of the Activator class to something else, it's still giving me the exact same error using the old class name.</p>
  
  <p>Apparently eclipse is caching something, but I have no idea what or why. 
  I've tried restarting eclipse, and rebuilding all projects in my workspace, but nothing helps.</p>
  
  <p>Here is my MANIFEST.MF:</p>
  
  <pre><code>Manifest-Version: 1.0
  Bundle-ManifestVersion: 2
  Bundle-Name: org.pathvisio.sbgn
  Bundle-SymbolicName: org.pathvisio.sbgn
  Bundle-Version: 1.0.0.qualifier
  Bundle-Activator: org.pathvisio.sbgn.Activator
  Bundle-ClassPath: lib/activation.jar,
   lib/google-collect-snapshot-20090211.jar,
   lib/jaxb-api.jar,
   lib/jaxb-impl.jar,
   lib/jaxb-xjc.jar,
   lib/jaxb1-impl.jar,
   lib/jsr173_1.0_api.jar,
   lib/org.sbgn.jar
  Export-Package: org.pathvisio.sbgn
  Require-Bundle: com.springsource.org.jdom;bundle-version="1.1.0",
   org.pathvisio.core;bundle-version="2.0.11",
   org.bridgedb;bundle-version="1.1.0",
   org.pathvisio.gui;bundle-version="2.0.11",
   org.pathvisio.desktop;bundle-version="2.0.11",
   org.bridgedb.bio;bundle-version="1.1.0"
  Import-Package: org.osgi.framework;version="1.5.0"
  </code></pre>
  
  <p>As you can see I renamed the activator class, but it's still reporting the error using the class name that I specified previously.</p>