我有一个捆绑包org.acme.plugin
和一个片段org.acme.plugin.fragment
。该片段定义了类EarlyStartup
和使用它的扩展点:
public class EarlyStartup implements IStartup {
@Override
public void earlyStartup() {
// do some magic
}
}
<fragment>
<extension point="org.eclipse.ui.startup">
<startup class="org.acme.plugin.EarlyStartup" />
</extension>
</fragment>
所有这些在RCP 4.7中都可以很好地工作,但是现在我更新到4.8,并收到以下异常:
org.eclipse.core.runtime.CoreException: Plug-in org.acme.plugin was unable to load class org.acme.plugin.EarlyStartup.
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:197)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:179)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:931)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:60)
at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:281)
at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:53)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.Workbench$40.run(Workbench.java:2758)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
java.lang.ClassNotFoundException: org.acme.plugin.EarlyStartup cannot be found by org.acme.plugin_1.2.3
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:609)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:177)
出什么问题了?为何插件无法再找到该类?