Where Is This Exception Coming From? RunConfig From Context

I am trying to make the Run Config from context as per here.

http://confluence.jetbrains.com/display/IDEADEV/Run+Configurations#RunConfigurations-CreatingConfigurationsfromContext

you need to provide an implementation of the RunConfigurationProducer interface and to register it as <runConfigurationProducer> in your plugin.xml.


BTW: That class is abstract now not an interface

I added the following to my plugin.xml and just let IDEA auto-generate the class and put break points on each method.

<idea-plugin version="2" url="https://github.com/opticyclic/antdebugger/">
    <depends optional="false">AntSupport</depends>
    <!--TODO: Can we remove dependency on Java so it can be used in other IDEA products?-->
    <depends>com.intellij.modules.java</depends>
    <name>Ant Debugger v1.3.0</name>
    <!--Added the extra ant package so that the plugin repo will accept this as a different plugin-->
    <id>com.handyedit.ant.AntDebugger</id>

    <idea-version since-build="13.0"/>

    <application-components>
    </application-components>

    <actions>
    </actions>

    <extensions defaultExtensionNs="com.intellij">
        <runConfigurationProducer implementation="com.handyedit.ant.run.AntRunConfigurationProducer"/>

        <configurationType implementation="com.handyedit.ant.run.AntRunConfigurationType"/>

        <xdebugger.breakpointType implementation="com.handyedit.ant.xdebug.AntLineBreakpointType"/>

        <programRunner implementation="com.handyedit.ant.breakpoint.AntDebugRunner"/>

    </extensions>
</idea-plugin>



However, the breakpoints don't get hit and the error below gets created.
I don't know what the dependencies that are missing.

com.intellij.openapi.extensions.impl.PicoPluginExtensionInitializationException: com.handyedit.ant.run.AntRunConfigurationProducer has unsatisfied dependency: interface com.intellij.execution.configurations.ConfigurationType among unsatisfiable dependencies: [[interface com.intellij.execution.configurations.ConfigurationType], [class com.intellij.execution.configurations.ConfigurationFactory]] where AreaPicoContainer[null] was the leaf container being asked for dependencies.
     at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getComponentInstance(ExtensionComponentAdapter.java:99)
     at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getExtension(ExtensionComponentAdapter.java:122)
     at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapters(ExtensionPointImpl.java:244)
     at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensions(ExtensionPointImpl.java:194)
     at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:111)
     at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:98)
     at com.intellij.execution.actions.PreferredProducerFind.getConfigurationsFromContext(PreferredProducerFind.java:105)
     at com.intellij.execution.actions.PreferredProducerFind.findConfigurationFromContext(PreferredProducerFind.java:131)
     at com.intellij.execution.actions.PreferredProducerFind.createConfiguration(PreferredProducerFind.java:43)
     at com.intellij.execution.actions.ConfigurationContext.createConfiguration(ConfigurationContext.java:119)
     at com.intellij.execution.actions.ConfigurationContext.getConfiguration(ConfigurationContext.java:112)
     at com.intellij.execution.actions.BaseRunConfigurationAction.update(BaseRunConfigurationAction.java:187)
     at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:111)
     at com.intellij.openapi.actionSystem.impl.Utils.doUpdate(Utils.java:187)
     at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:138)
     at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:163)
     at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:163)
     at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:163)
     at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:163)
     at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:85)
     at com.intellij.openapi.actionSystem.impl.Utils.fillMenu(Utils.java:279)
     at com.intellij.openapi.actionSystem.impl.ActionPopupMenuImpl$MyMenu$MyPopupMenuListener.popupMenuWillBecomeVisible(ActionPopupMenuImpl.java:191)
     at javax.swing.JPopupMenu.firePopupMenuWillBecomeVisible(JPopupMenu.java:623)
     at javax.swing.JPopupMenu.setVisible(JPopupMenu.java:730)
     at com.intellij.openapi.actionSystem.impl.ActionPopupMenuImpl$MyMenu.setVisible(ActionPopupMenuImpl.java:168)
     at javax.swing.JPopupMenu.show(JPopupMenu.java:904)
     at com.intellij.openapi.actionSystem.impl.ActionPopupMenuImpl$MyMenu.show(ActionPopupMenuImpl.java:163)
     at com.intellij.openapi.fileEditor.impl.text.TextEditorComponent$MyEditorMouseListener.invokePopup(TextEditorComponent.java:293)
     at com.intellij.util.EditorPopupHandler.handle(EditorPopupHandler.java:27)
     at com.intellij.util.EditorPopupHandler.mouseReleased(EditorPopupHandler.java:41)
     at com.intellij.openapi.editor.impl.EditorImpl$MyMouseAdapter.runMouseReleasedCommand(EditorImpl.java:5540)
     at com.intellij.openapi.editor.impl.EditorImpl$MyMouseAdapter.mouseReleased(EditorImpl.java:5447)
     at java.awt.Component.processMouseEvent(Component.java:6288)
     at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
     at java.awt.Component.processEvent(Component.java:6053)
     at java.awt.Container.processEvent(Container.java:2041)
     at java.awt.Component.dispatchEventImpl(Component.java:4651)
     at java.awt.Container.dispatchEventImpl(Container.java:2099)
     at java.awt.Component.dispatchEvent(Component.java:4481)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
     at java.awt.Container.dispatchEventImpl(Container.java:2085)
     at java.awt.Window.dispatchEventImpl(Window.java:2478)
     at java.awt.Component.dispatchEvent(Component.java:4481)
     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
     at java.awt.EventQueue.access$000(EventQueue.java:84)
     at java.awt.EventQueue$1.run(EventQueue.java:602)
     at java.awt.EventQueue$1.run(EventQueue.java:600)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
     at java.awt.EventQueue$2.run(EventQueue.java:616)
     at java.awt.EventQueue$2.run(EventQueue.java:614)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
     at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
     at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:520)
     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: org.picocontainer.defaults.UnsatisfiableDependenciesException: com.handyedit.ant.run.AntRunConfigurationProducer has unsatisfied dependency: interface com.intellij.execution.configurations.ConfigurationType among unsatisfiable dependencies: [[interface com.intellij.execution.configurations.ConfigurationType], [class com.intellij.execution.configurations.ConfigurationFactory]] where AreaPicoContainer[null] was the leaf container being asked for dependencies.
     at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getGreediestSatisfiableConstructor(ConstructorInjectionComponentAdapter.java:191)
     at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:210)
     at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
     at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
     at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:60)
     at org.picocontainer.defaults.CachingComponentAdapter.getComponentInstance(CachingComponentAdapter.java:58)
     at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getComponentInstance(ExtensionComponentAdapter.java:75)
     ... 65 more
Caused by:

org.picocontainer.defaults.UnsatisfiableDependenciesException: com.handyedit.ant.run.AntRunConfigurationProducer has unsatisfied dependency: interface com.intellij.execution.configurations.ConfigurationType among unsatisfiable dependencies: [[interface com.intellij.execution.configurations.ConfigurationType], [class com.intellij.execution.configurations.ConfigurationFactory]] where AreaPicoContainer[null] was the leaf container being asked for dependencies.
     at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getGreediestSatisfiableConstructor(ConstructorInjectionComponentAdapter.java:191)
     at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:210)
     at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
     at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
     at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:60)
     at org.picocontainer.defaults.CachingComponentAdapter.getComponentInstance(CachingComponentAdapter.java:58)
     at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getComponentInstance(ExtensionComponentAdapter.java:75)
     at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getExtension(ExtensionComponentAdapter.java:122)
     at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapters(ExtensionPointImpl.java:244)
     at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensions(ExtensionPointImpl.java:194)
     at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:111)
     at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:98)
     at com.intellij.execution.actions.PreferredProducerFind.getConfigurationsFromContext(PreferredProducerFind.java:105)
     at com.intellij.execution.actions.PreferredProducerFind.findConfigurationFromContext(PreferredProducerFind.java:131)
     at com.intellij.execution.actions.PreferredProducerFind.createConfiguration(PreferredProducerFind.java:43)
     at com.intellij.execution.actions.ConfigurationContext.createConfiguration(ConfigurationContext.java:119)
     at com.intellij.execution.actions.ConfigurationContext.getConfiguration(ConfigurationContext.java:112)
     at com.intellij.execution.actions.BaseRunConfigurationAction.update(BaseRunConfigurationAction.java:187)
     at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:111)
     at com.intellij.openapi.actionSystem.impl.Utils.doUpdate(Utils.java:187)
     at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:138)
     at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:163)
     at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:163)
     at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:163)
     at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:163)
     at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:85)
     at com.intellij.openapi.actionSystem.impl.Utils.fillMenu(Utils.java:279)
     at com.intellij.openapi.actionSystem.impl.ActionPopupMenuImpl$MyMenu$MyPopupMenuListener.popupMenuWillBecomeVisible(ActionPopupMenuImpl.java:191)
     at javax.swing.JPopupMenu.firePopupMenuWillBecomeVisible(JPopupMenu.java:623)
     at javax.swing.JPopupMenu.setVisible(JPopupMenu.java:730)
     at com.intellij.openapi.actionSystem.impl.ActionPopupMenuImpl$MyMenu.setVisible(ActionPopupMenuImpl.java:168)
     at javax.swing.JPopupMenu.show(JPopupMenu.java:904)
     at com.intellij.openapi.actionSystem.impl.ActionPopupMenuImpl$MyMenu.show(ActionPopupMenuImpl.java:163)
     at com.intellij.openapi.fileEditor.impl.text.TextEditorComponent$MyEditorMouseListener.invokePopup(TextEditorComponent.java:293)
     at com.intellij.util.EditorPopupHandler.handle(EditorPopupHandler.java:27)
     at com.intellij.util.EditorPopupHandler.mouseReleased(EditorPopupHandler.java:41)
     at com.intellij.openapi.editor.impl.EditorImpl$MyMouseAdapter.runMouseReleasedCommand(EditorImpl.java:5540)
     at com.intellij.openapi.editor.impl.EditorImpl$MyMouseAdapter.mouseReleased(EditorImpl.java:5447)
     at java.awt.Component.processMouseEvent(Component.java:6288)
     at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
     at java.awt.Component.processEvent(Component.java:6053)
     at java.awt.Container.processEvent(Container.java:2041)
     at java.awt.Component.dispatchEventImpl(Component.java:4651)
     at java.awt.Container.dispatchEventImpl(Container.java:2099)
     at java.awt.Component.dispatchEvent(Component.java:4481)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
     at java.awt.Container.dispatchEventImpl(Container.java:2085)
     at java.awt.Window.dispatchEventImpl(Window.java:2478)
     at java.awt.Component.dispatchEvent(Component.java:4481)
     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
     at java.awt.EventQueue.access$000(EventQueue.java:84)
     at java.awt.EventQueue$1.run(EventQueue.java:602)
     at java.awt.EventQueue$1.run(EventQueue.java:600)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
     at java.awt.EventQueue$2.run(EventQueue.java:616)
     at java.awt.EventQueue$2.run(EventQueue.java:614)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
     at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
     at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:520)
     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
[  62396]  ERROR - penapi.actionSystem.impl.Utils - IntelliJ IDEA (Community Edition) IC-134.1160  Build #IC-134.1160
[  62396]  ERROR - penapi.actionSystem.impl.Utils - JDK: 1.6.0_29
[  62396]  ERROR - penapi.actionSystem.impl.Utils - VM: Java HotSpot(TM) 64-Bit Server VM
[  62396]  ERROR - penapi.actionSystem.impl.Utils - Vendor: Sun Microsystems Inc.
[  62396]  ERROR - penapi.actionSystem.impl.Utils - OS: Windows 7
[  62396]  ERROR - penapi.actionSystem.impl.Utils - Last Action:  

2 comments

If I click on  RunConfigurationProducer then Alt-Enter Implement Abstract class IDEA genereates this:

package com.handyedit.ant.run;

import com.intellij.execution.actions.ConfigurationContext;
import com.intellij.execution.actions.RunConfigurationProducer;
import com.intellij.execution.configurations.ConfigurationFactory;
import com.intellij.execution.configurations.ConfigurationType;
import com.intellij.execution.configurations.RunConfiguration;
import com.intellij.openapi.util.Ref;
import com.intellij.psi.PsiElement;

public class RunConfigurationProducerImpl<T extends RunConfiguration> extends RunConfigurationProducer<T> {

    protected RunConfigurationProducerImpl(ConfigurationFactory configurationFactory) {
        super(configurationFactory);
    }

    protected RunConfigurationProducerImpl(ConfigurationType configurationType) {
        super(configurationType);
    }

    @Override
    protected boolean setupConfigurationFromContext(T configuration, ConfigurationContext context, Ref<PsiElement> sourceElement) {
        return true;
    }

    @Override
    public boolean isConfigurationFromContext(T configuration, ConfigurationContext context) {
        return true;
    }
}


That still generates the above error.

If I extend the JavaRunConfigurationProducerBase the Create Config from Context works (although it is the Java Run Config that pops up not mine)

package com.handyedit.ant.run;

import com.intellij.execution.actions.ConfigurationContext;
import com.intellij.execution.application.ApplicationConfiguration;
import com.intellij.execution.application.ApplicationConfigurationType;
import com.intellij.execution.junit.JavaRunConfigurationProducerBase;
import com.intellij.openapi.util.Ref;
import com.intellij.psi.PsiElement;

public class AntRunJavaConfigurationProducer extends JavaRunConfigurationProducerBase<ApplicationConfiguration> {

    public AntRunJavaConfigurationProducer() {
        super(ApplicationConfigurationType.getInstance());
    }

    @Override
    protected boolean setupConfigurationFromContext(ApplicationConfiguration configuration,
                                                    ConfigurationContext context,
                                                    Ref<PsiElement> sourceElement) {
        return true;
    }

    @Override
    public boolean isConfigurationFromContext(ApplicationConfiguration appConfiguration, ConfigurationContext context) {
        return true;
    }
}



If I copy and paste the  JavaRunConfigurationProducerBase class instead of extending it I get the error again.

I have AntRunConfigurationFactory extends ConfigurationFactory and AntRunConfigurationType implements ConfigurationType.

This error isn't very clear and the documentation doesn't seem to match up with what I am seeing :(
0

I think it is just the Generics messing it up.
It seems to work fine like this.

public class AntRunConfigurationProducer extends RunConfigurationProducer<AntRunConfiguration> {

    protected AntRunConfigurationProducer(AntRunConfigurationType configurationType) {
        super(configurationType);
    }

    @Override
    protected boolean setupConfigurationFromContext(AntRunConfiguration configuration, ConfigurationContext context, Ref<PsiElement> sourceElement) {
        return true;
    }

    @Override
    public boolean isConfigurationFromContext(AntRunConfiguration configuration, ConfigurationContext context) {
        return true;
    }

    @Override
    public boolean isPreferredConfiguration(ConfigurationFromContext self, ConfigurationFromContext other) {
        return other.isProducedBy(AntRunConfigurationProducer.class);
    }
}



I guess I don't understand Pico enough to see where all the dependencies are defined.
0

Please sign in to leave a comment.