Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
作为eclipse应用程序运行tycho eclipse插件_Eclipse_Maven_Tycho - Fatal编程技术网

作为eclipse应用程序运行tycho eclipse插件

作为eclipse应用程序运行tycho eclipse插件,eclipse,maven,tycho,Eclipse,Maven,Tycho,我刚刚用tycho创建了一个eclipse插件。我可以运行mvn clean install,到目前为止没有错误 现在我想以Eclipse应用程序的形式运行插件(它基本上是一个构建器)。当我按下runaseclipseapplication时,会出现第二个Eclipse实例。当我在那里创建一个新项目并添加我的生成器时,eclipse向我抛出以下异常: org.eclipse.e4.core.di.InjectionException: org.eclipse.core.commands.Exec

我刚刚用tycho创建了一个eclipse插件。我可以运行
mvn clean install
,到目前为止没有错误

现在我想以Eclipse应用程序的形式运行插件(它基本上是一个构建器)。当我按下
runaseclipseapplication
时,会出现第二个Eclipse实例。当我在那里创建一个新项目并添加我的生成器时,eclipse向我抛出以下异常:

org.eclipse.e4.core.di.InjectionException: org.eclipse.core.commands.ExecutionException: Failed to toggle nature

Caused by: org.eclipse.core.commands.ExecutionException: Failed to toggle nature

Caused by: org.eclipse.core.runtime.CoreException: Problems encountered while setting project description
错误发生在该方法中:

   private void toggleNature(IProject project) throws CoreException {

        IProjectDescription description = project.getDescription();
        String[] natures = description.getNatureIds();

        for (int i = 0; i < natures.length; ++i) {
            if (SidecarNature.NATURE_ID.equals(natures[i])) {
                // Remove the nature
                String[] newNatures = new String[natures.length - 1];
                System.arraycopy(natures, 0, newNatures, 0, i);
                System.arraycopy(natures, i + 1, newNatures, i, natures.length - i - 1);
                description.setNatureIds(newNatures);
                project.setDescription(description, null);
                return;
            }
        }

        // Add the nature
        String[] newNatures = new String[natures.length + 1];
        System.arraycopy(natures, 0, newNatures, 0, natures.length);
        newNatures[natures.length] = SidecarNature.NATURE_ID;
        description.setNatureIds(newNatures);


        // ---------------------------------------
        // The Error is thrown here
        // ---------------------------------------
        project.setDescription(description, null);
    }
Edit2
IStatus

Status WARNING: org.eclipse.core.resources code=568 Problems encountered while setting project description. null children=[[type: WARNING], [path: null], [message: Nature does not exist: eclipseintegration.builder.SidewiseNature.], [plugin: org.eclipse.core.resources], [exception: null]
]

IStatus
Nature中的消息不存在:eclipseintegration.builder.SidewiseNature。
表示您正在尝试添加一个不存在的Nature


您是否使用扩展点
org.eclipse.core.resources.natures
声明了nature?这里声明的id是否与
sidecarature.NATURE\u id
常量匹配?

显示完整堆栈trace@greg-谢谢,编辑我的问题您需要查看“设置项目描述时遇到的问题”中的
IStatus
,因为这将包含有关问题的详细信息。@greg-449谢谢,IStatus对我来说是新的。我编辑了上面的问题。plugin.xml不知怎么被错误配置了,尽管我根本没碰它。已经修好了,谢谢格雷格。
org.eclipse.e4.core.di.InjectionException: org.eclipse.core.commands.ExecutionException: Failed to toggle nature
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:68)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:493)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:799)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.handleWidgetSelection(HandledContributionItem.java:675)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$7(HandledContributionItem.java:659)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$4.handleEvent(HandledContributionItem.java:592)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4230)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1491)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1514)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1499)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1299)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4072)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3698)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Caused by: org.eclipse.core.commands.ExecutionException: Failed to toggle nature
    at de.ustutt.sidewise.eclipseintegration.builder.AddRemoveSidewiseNatureHandler.execute(AddRemoveSidewiseNatureHandler.java:37)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
    ... 41 more
Caused by: org.eclipse.core.runtime.CoreException: Problems encountered while setting project description.
    at org.eclipse.core.internal.resources.Project.setDescription(Project.java:1256)
    at org.eclipse.core.internal.resources.Project.setDescription(Project.java:1281)
    at de.ustutt.sidewise.eclipseintegration.builder.AddRemoveSidewiseNatureHandler.toggleNature(AddRemoveSidewiseNatureHandler.java:78)
    at de.ustutt.sidewise.eclipseintegration.builder.AddRemoveSidewiseNatureHandler.execute(AddRemoveSidewiseNatureHandler.java:34)
    ... 48 more
Status WARNING: org.eclipse.core.resources code=568 Problems encountered while setting project description. null children=[[type: WARNING], [path: null], [message: Nature does not exist: eclipseintegration.builder.SidewiseNature.], [plugin: org.eclipse.core.resources], [exception: null]
]