[MYAA-1474] Minyaa Plugins can be disabled from the UPM Created: 22/Oct/14  Updated: 24/Nov/17  Resolved: 24/Nov/17

Status: Closed
Project: Minyaa Suite
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Blocker
Reporter: Vincent Thoulé Assignee: Vincent Thoulé
Resolution: Obsolete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

JIRA Release:
6.2.x, 6.3.x

 Comments   
Comment by Vincent Thoulé [ 22/Oct/14 ]

An support request has been raised to Atlassian Developper team with follwing details :

When trying tot disable a plugin v1, it fails with the error "org.picocontainer.PicoCompositionException: Duplicate Keys not allowed. Duplicate for 'xxxx'".

After some search in JIRA source code and found this ....

Before 6.2, the method ComponentModuleDescriptor.unregisterComponents() was :

    public void unregisterComponents(final MutablePicoContainer container)
    {
        // Check that we have classloaded the interface if required.
        if (interfaceClazzName != null && interfaceClazz == null)
        {
            throw new PluginException("Cannot unregister component '" + interfaceClazzName + "' in plugin '" + getKey() +
                "' because we haven't loaded the class. This means that this plugin has not been successfully enabled.");
        }

        if (container.getComponentAdapter(interfaceClazz) != null)
        {
            container.unregisterComponent(interfaceClazz);
        }
        // TODO: Should this be in an else clause? It is probably harmless, but also pointless.
        container.unregisterComponent(getModuleClass());
    }

Since 6.2, the method ComponentModuleDescriptor.unregisterComponents() is now :

    public void unregisterComponents(final MutablePicoContainer container)
    {
        // Check that we have classloaded the interface if required.
        if (interfaceClazzName != null && interfaceClazz == null)
        {
            throw new PluginException("Cannot unregister component '" + interfaceClazzName + "' in plugin '" + getKey() +
                "' because we haven't loaded the class. This means that this plugin has not been successfully enabled.");
        }

        if (container.getComponentAdapter(interfaceClazz) != null)
        {
            container.removeComponent(interfaceClazz);
        }
        // TODO: Should this be in an else clause? It is probably harmless, but also pointless.
        container.addComponent(getModuleClass());
    }

I did not invest more about the cause of this change (probably due to some change the Container), but it is strange that the last line :

container.unregisterComponent(getModuleClass());

is replaced by

container.addComponent(getModuleClass());

I am waiting for a return to confirm that it is a JIRA Bug.

Comment by Vincent Thoulé [ 23/Oct/14 ]

Bug seems to be confirmed by Atlassian Dev. Relation.
The Bug has been raised to Atlassian JIRA Team : JRA-40530.

To follow...

Generated at Tue Dec 11 12:21:24 CET 2018 using JIRA 7.3.7#73018-sha1:17f7a2e4314e5442e36799ac64ba66469353a4b7.