Uploaded image for project: 'Minyaa Suite'
  1. Minyaa Suite
  2. MYAA-1084

Init of Greenhopper raises a too early call of CustomFieldManager, that init load of Minyaa Customfield. If one of CF has dependencies on Minyaa Components (Not yet loaded), then JIRA is locked

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.2.1
    • None
    • None
    • Security Level: Public
    • None

      If CustomfieldManager is called by any Plugin during the start of JIRA (here GreenHopper, but it may true for any other plugin), then the CustomfieldManager tries to load any defined customfield.
      If one these customfield has dependencies on component provided by a plugin, this plugin may be not yet loaded. In such case, a org.picocontainer.defaults.UnsatisfiableDependenciesException is raised, JIRA is locked and is not available.

      Classically, a Customfield looks like :

      public class MyCFType {
         protected final OneJIRAComponent oneJIRAComponent;
         protected final OtherJIRAComponent otherJIRAComponent;
         protected final MyPluginComponent myPluginComponent;
      	
         public MyCFType(OneJIRAComponent oneJIRAComponent, OtherJIRAComponent otherJIRAComponent, MyPluginComponent myPluginComponent) {
            this.oneJIRAComponent = oneJIRAComponent;
            this.otherJIRAComponent = otherJIRAComponent;
            this.myPluginComponent = myPluginComponent;
         }
         
         public anyMethod() {
            oneJIRAComponent.doSomething();
            otherJIRAComponent.doSomething();
            myPluginComponent.doSomething();
         }
      }
      

      To avoid the current issue, it would be better to do :

      public class MyCFType {
         protected final OneJIRAComponent oneJIRAComponent;
         protected final OtherJIRAComponent otherJIRAComponent;
         protected MyPluginComponent myPluginComponent;
      
         public MyCFType(OneJIRAComponent oneJIRAComponent, OtherJIRAComponent otherJIRAComponent) {
            this.oneJIRAComponent = oneJIRAComponent;
            this.otherJIRAComponent = otherJIRAComponent;
         }
         
         public anyMethod() {
            oneJIRAComponent.doSomething();
            otherJIRAComponent.doSomething();
            getMyPluginComponent().doSomething();
         }
         
         public MyPluginComponent getMyPluginComponent() {
            if (myPluginComponent == null) {
               myPluginComponent = (MyPluginComponent)ComponentManager.getComponentInstanceOfType(MyPluginComponent.class);
            }
            return myPluginComponent;
         }
      }
      

            vthoule Vincent Thoulé
            vthoule Vincent Thoulé
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: