org.eclipse.ui.PartInitException:无法创建视图?

时间:2011-12-08 10:25:55

标签: eclipse eclipse-pde

我使用定义视图的插件:

   <extension
         point="org.eclipse.ui.perspectiveExtensions">
      <perspectiveExtension
            targetID="org.eclipse.ui.resourcePerspective">
         <view
               ratio="0.5"
               relative="org.eclipse.ui.views.TaskList"
               id="com.essiembre.eclipse.i18n.resourcebundle.views.ResourceBundleView"
               relationship="right">
         </view>
      </perspectiveExtension>
   </extension>

但是当我开始申请时,我得到了:

!ENTRY org.eclipse.ui 4 4 2011-12-08 11:06:05.029
!MESSAGE Exception in org.eclipse.ui.internal.PageLayout.addView: org.eclipse.ui.PartInitException: Could not create view: com.essiembre.eclipse.i18n.resourcebundle.views.ResourceBundleView
!STACK 1
org.eclipse.ui.PartInitException: Could not create view: com.essiembre.eclipse.i18n.resourcebundle.views.ResourceBundleView
    at org.eclipse.ui.internal.ViewFactory.createView(ViewFactory.java:158)

....    

!SUBENTRY 1 org.eclipse.ui 4 0 2011-12-08 11:06:05.030
!MESSAGE Could not create view: com.essiembre.eclipse.i18n.resourcebundle.views.ResourceBundleView  

我试图将断点放在一行:

IViewDescriptor desc = viewReg.find(id);

下面:

public IViewReference createView(String id, String secondaryId)
        throws PartInitException {
    IViewDescriptor desc = viewReg.find(id);
    // ensure that the view id is valid
    if (desc == null) {
            throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate,  id ));
        }

并查看osgi控制台中bundle的状态:

2   ACTIVE      com.essiembre.eclipse.i18n.resourcebundle_0.7.7.200809291519

因此,当尝试从'viewReg'读取时,捆绑包处于活动状态。实际上它在工作台时具有相同的状态 最初创建并开始:

public static final int createAndRunWorkbench(final Display display,
        final WorkbenchAdvisor advisor) {
    final int[] returnCode = new int[1];
    Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
        public void run() {
            ULocale.setDefault(new ULocale(Platform.getNL() 

无法创建视图com.essiembre.eclipse.i18n.resourcebundle.views.ResourceBundleView的任何想法?

这是完整的plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>
<plugin>
   <extension
         point="org.eclipse.ui.editors">
      <editor
            name="%editor.rbe"
            icon="icons/propertiesfile.gif"
            extensions="properties"
            class="com.essiembre.eclipse.rbe.ui.editor.ResourceBundleEditor"
            contributorClass="com.essiembre.eclipse.rbe.ui.editor.ResourceBundleEditorContributor"
            id="com.essiembre.eclipse.rbe.ui.editor.ResourceBundleEditor">
      </editor>
   </extension>
   <extension
         point="org.eclipse.ui.newWizards">
      <category
            name="%wizard.rb"
            id="com.essiembre.eclipse.i18n.resourcebundle">
      </category>
      <wizard
            name="ResourceBundle"
            icon="icons/resourcebundle.gif"
            category="com.essiembre.eclipse.i18n.resourcebundle"
            class="com.essiembre.eclipse.rbe.ui.wizards.ResourceBundleWizard"
            id="com.essiembre.eclipse.rbe.ui.wizards.ResourceBundleWizard">
            <description> 
               %wizard.description 
            </description> 
      </wizard>
   </extension>
   <extension
         point="org.eclipse.ui.preferencePages">
      <page
            name="%editor.rbe"
            class="com.essiembre.eclipse.rbe.ui.preferences.RBEGeneralPrefPage"
            id="com.essiembre.eclipse.rbe.ui.preferences.RBEGeneralPrefPage">
      </page>
      <page
            class="com.essiembre.eclipse.rbe.ui.preferences.RBEFormattingPrefPage"
            category="com.essiembre.eclipse.rbe.ui.preferences.RBEGeneralPrefPage"
            name="%prefs.formatting"
            id="com.essiembre.eclipse.rbe.ui.preferences.RBEFormattingPrefPage"/>
      <page
            class="com.essiembre.eclipse.rbe.ui.preferences.RBEReportingPrefPage"
            category="com.essiembre.eclipse.rbe.ui.preferences.RBEGeneralPrefPage"
            name="%prefs.performance"
            id="com.essiembre.eclipse.rbe.ui.preferences.RBEReportingPrefPage"/>
   </extension>
   <extension
         point="org.eclipse.ui.perspectiveExtensions">
      <perspectiveExtension
            targetID="org.eclipse.ui.resourcePerspective">
         <view
               ratio="0.5"
               relative="org.eclipse.ui.views.TaskList"
               id="com.essiembre.eclipse.i18n.resourcebundle.views.ResourceBundleView"
               relationship="right">
         </view>
      </perspectiveExtension>
   </extension>
   <extension
         point="org.eclipse.core.runtime.preferences">
      <initializer
            class="com.essiembre.eclipse.rbe.ui.preferences.RBEPreferenceInitializer">
      </initializer>
   </extension>

</plugin>

0 个答案:

没有答案