不寻常的eclipse插件问题

时间:2010-11-01 12:40:40

标签: eclipse

我有这个非常不寻常的问题。 我用属性页开发了这个插件。当我作为Eclipse应用程序运行插件时,它运行得很好,但是当我导出它并将其复制到eclipse / dropin文件夹时,我得到了ClassNotFoundException。

我的Manifest.mf看起来像这样:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SpectrumPlugin
Bundle-SymbolicName: sinaut.spectrum.plugin; singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: sinaut.spectrum.plugin.activator.SpectrumPluginActivator
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.4.0",
 org.eclipse.ui;bundle-version="3.4.2",
 org.eclipse.core.resources;bundle-version="3.4.2",
 org.eclipse.ui.console;bundle-version="3.3.1"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: JARs/sshfactory.jar,
 .
Import-Package: org.eclipse.ui.console
Export-Package: com.jscape.a,
 sinaut.spectrum.plugin.activator,
 sinaut.spectrum.plugin.ftp,
 sinaut.spectrum.plugin.preferences,
 sinaut.spectrum.plugin.remotebuild,
 sinaut.spectrum.plugin.ssh

plugin.xml如下所示:

<plugin>

   <extension
         point="org.eclipse.ui.preferencePages">
      <page
        id="BildPreferencePage"
            name="Bild Preferences"
            class="sinaut.spectrum.plugin.preferences.BildPreferencePage"

            >
      </page>
   </extension>
   <extension
         point="org.eclipse.core.runtime.preferences">
      <initializer
            class="sinaut.spectrum.plugin.preferences.PreferenceInitializer">
      </initializer>
   </extension>
   <extension
         point="org.eclipse.ui.actionSets">
      <actionSet
            id="sinaut.spectrum.plugin.RemoteBildActionSet"
            label="RemoteBildActionSet"
            visible="true">
         <menu
               id="sinaut.spectrum.plugin.RemoteBuildMenu"
               label="Remote Build Menu">
            <groupMarker
                  name="content">
            </groupMarker>
            <separator
                  name="additions">
            </separator>
         </menu>
         <action
               class="sinaut.spectrum.plugin.remotebuild.RemoteBuild"
               icon="/icons/rb.gif"
               id="sinaut.spectrum.plugin.RemoteBuild"
               label="Remote Build"
               state="true"
               style="push"
               toolbarPath="Normal/additions">
         </action>
      </actionSet>
   </extension>

</plugin>

当我尝试使用此堆栈跟踪启动此属性页"Unable to create the selected preference page.sinaut.spectrum.plugin.preferences.BildPreferencePage"时,我收到此消息:

java.lang.ClassNotFoundException: sinaut.spectrum.plugin.preferences.BildPreferencePage
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:483)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:315)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1274)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:160)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:867)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:267)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:263)
at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.createPage(WorkbenchPreferenceNode.java:47)
at org.eclipse.jface.preference.PreferenceDialog.createPage(PreferenceDialog.java:1306)
at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.createPage(FilteredPreferenceDialog.java:385)
at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1197)
at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:682)
at org.eclipse.jface.preference.PreferenceDialog$10.run(PreferenceDialog.java:702)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:698)
at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:842)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:840)
at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1153)
at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1178)
at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:250)
at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:244)
at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:418)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3378)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3036)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

一定是蠢事,但我看不出来。 如果有人可以帮我这个。我已经被困了好几个小时了。

1 个答案:

答案 0 :(得分:0)

使用以下参数启动eclipse

 -console

然后在OSGi控制台中找到您的插件ID,如

ss sinaut.spectrum.plugin

最后使用diag查看无法解析插件的原因

diag <id found by ss command>

并尝试启动它以查看其激活器中是否有任何错误

start <id>