You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Greg Rapp (JIRA)" <ji...@apache.org> on 2011/02/23 06:09:38 UTC

[jira] Created: (ARIES-584) Blueprint Managed Service Factory Registers Duplicate Service

Blueprint Managed Service Factory Registers Duplicate Service
-------------------------------------------------------------

                 Key: ARIES-584
                 URL: https://issues.apache.org/jira/browse/ARIES-584
             Project: Aries
          Issue Type: Bug
          Components: Blueprint
    Affects Versions: 0.3, 0.2
         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
            Reporter: Greg Rapp


Creating a simple managed service factory, two services are instantiated for a single factory configuration.


-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Holly Cummins (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Holly Cummins reassigned ARIES-584:
-----------------------------------

    Assignee: Holly Cummins
    
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>            Assignee: Holly Cummins
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (ARIES-584) Blueprint Managed Service Factory Registers Duplicate Service

Posted by "Greg Rapp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998162#comment-12998162 ] 

Greg Rapp commented on ARIES-584:
---------------------------------

Blueprint XML definition -

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
			xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0">
			
	<cm:managed-service-factory id="testfactory"
		factory-pid="testfactory" interface="testplugin.ServerImpl"
		auto-export="all-classes">
		<cm:managed-component class="testplugin.ServerImpl" />
	</cm:managed-service-factory>
</blueprint>


> Blueprint Managed Service Factory Registers Duplicate Service
> -------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Marcel Hanser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420725#comment-13420725 ] 

Marcel Hanser commented on ARIES-584:
-------------------------------------

As I understand the OSGi Configuration Admin spec garantees that we are notified if there is already an existing configuration for a ManagedServiceFactory as the ConfigurationWatcher is one, so there is no need to additionally check it in the init() method? (See 104.6.2 OSGi compendium specification V 4.3 or 4.2).
{code}"When the Configuration Admin service detects the registration of a Managed Service Factory, it must find all configuration dictionaries for this factory and must then sequentially call ManagedServiceFactory.updated(String,Dictionary) for each configuration dictionary. The first argument is the PID of the Configuration object (the one created by the Configuration Admin service) and the second argument contains the configuration properties."{code}
This would also reduce the critical area for a deadlock. If you call the updated method on your own during the init() method the chance to get caught into the deadlock described here https://issues.apache.org/jira/browse/ARIES-867 increases. Clear: the deadlock situation is not totally  mitigated due to the service registration in the init() method, while holding the BlueprintContainer lock...
                
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>            Assignee: Guillaume Nodet
>             Fix For: 1.0
>
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet reassigned ARIES-584:
-------------------------------------

    Assignee: Guillaume Nodet  (was: Holly Cummins)
    
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>            Assignee: Guillaume Nodet
>             Fix For: 1.0
>
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Hendy Irawan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421221#comment-13421221 ] 

Hendy Irawan commented on ARIES-584:
------------------------------------

Thank you Guillaume ! :)

BTW forgive me to ask again... is there any plans to support managed service factory properties without implementing 'updated()' ? i.e. using the same behavior as managed service (bean initially created using managed properties, if the managed properties change then the bean gets reloaded).
                
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>            Assignee: Guillaume Nodet
>             Fix For: 1.0
>
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Holly Cummins (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Holly Cummins resolved ARIES-584.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0
    
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>            Assignee: Holly Cummins
>             Fix For: 1.0
>
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Hendy Irawan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13419887#comment-13419887 ] 

Hendy Irawan commented on ARIES-584:
------------------------------------

Thank you Holly !

BTW... is there any plans to support managed service factory properties without implementing 'updated()' ? i.e. using the same behavior as managed service (bean initially created using managed properties, if the managed properties change then the bean gets reloaded).
                
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>            Assignee: Holly Cummins
>             Fix For: 1.0
>
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Holly Cummins (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13419842#comment-13419842 ] 

Holly Cummins commented on ARIES-584:
-------------------------------------

Fixed in the nick of time, before the blueprint.cm release. Thanks for the patch. 

I had some difficulty reproducing this problem in our ConfigAdminTest. However, I could sometimes reproduce it, which makes me conclude there's a concurrency element to the problem. I think this means the patch isn't quite the right fix, although it definitely points to the right area. 

The updated() method on the CmManagedServiceFactory does checks if the pid exists, and only registers a service if the pid doesn't, so calling it twice shouldn't be a problem. Problems do happen when the updated() method is driven by both the init() method and configuration admin concurrently. My suspicion is that removing the updated() call in the init method exposes us to problems - if the ConfigurationWatcher is registered too late, it won't be notified of config changes, and the service won't be registered at all. I've synchronized the updated() method so that we don't check whether the pid has been registered until we're sure any previous registration has completed. 

I've also updated our TestConfigAdmin test to make sure only one service is registered, although this test was passing even for the original code, unless I changed the concurrency by removing other tests.

I haven't applied a fix to the 0.3.1 branch, since I'm not sure if there will be more releases on that.
                
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>            Assignee: Holly Cummins
>             Fix For: 1.0
>
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet resolved ARIES-584.
-----------------------------------

    Resolution: Fixed

See rev. http://svn.apache.org/viewvc?view=revision&revision=1364914
                
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>            Assignee: Guillaume Nodet
>             Fix For: 1.0
>
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Marcel Hanser (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Hanser updated ARIES-584:
--------------------------------

    Attachment: org.apache.aries.blueprint.cm.patch-withtrunk.patch
    
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (ARIES-584) Blueprint Managed Service Factory Registers Duplicate Service

Posted by "Greg Rapp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998169#comment-12998169 ] 

Greg Rapp edited comment on ARIES-584 at 2/23/11 5:17 AM:
----------------------------------------------------------

Blueprint logs during container startup showing creation of the duplicate service instance

      was (Author: gdrapp):
    Blueprint logs during container startup showing creating of the duplicate service instance
  
> Blueprint Managed Service Factory Registers Duplicate Service
> -------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>         Attachments: logs.txt
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Greg Rapp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Rapp updated ARIES-584:
----------------------------

    Summary: Blueprint Managed Service Factory Instantiates Duplicate Service  (was: Blueprint Managed Service Factory Registers Duplicate Service)

> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>         Attachments: logs.txt
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (ARIES-584) Blueprint Managed Service Factory Registers Duplicate Service

Posted by "Greg Rapp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998164#comment-12998164 ] 

Greg Rapp commented on ARIES-584:
---------------------------------

Service code - 


package testplugin;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ServerImpl {

	Logger log = LoggerFactory.getLogger(ServerImpl.class);
	
	public ServerImpl() {
		log.error("************ Server Created!");
	}

	public void update (Map<String,?> props) {
		log.error("************ Configuration updated - {}.",props.toString());
	}	
}


> Blueprint Managed Service Factory Registers Duplicate Service
> -------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Hendy Irawan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13419721#comment-13419721 ] 

Hendy Irawan commented on ARIES-584:
------------------------------------

+1!

I really hope this gets resolved. Still happens on Aries Blueprint 0.3.2 / Karaf 2.2.8.
                
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Marcel Hanser (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Hanser updated ARIES-584:
--------------------------------

    Attachment: org.apache.aries.blueprint.cm-0.3.1.patch
    
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (ARIES-584) Blueprint Managed Service Factory Registers Duplicate Service

Posted by "Greg Rapp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Rapp updated ARIES-584:
----------------------------

    Attachment: logs.txt

Blueprint logs during container startup showing creating of the duplicate service instance

> Blueprint Managed Service Factory Registers Duplicate Service
> -------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>         Attachments: logs.txt
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet reopened ARIES-584:
-----------------------------------


I'd like to get that fixed in 0.3.x in case we need a new release (which might happen).
Also, I've learned that calling OSGi API while holding java locks is bound to lead to deadlocks, so I think we should find a better solution for that.
                
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>            Assignee: Guillaume Nodet
>             Fix For: 1.0
>
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ARIES-584) Blueprint Managed Service Factory Instantiates Duplicate Service

Posted by "Marcel Hanser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13402133#comment-13402133 ] 

Marcel Hanser commented on ARIES-584:
-------------------------------------

Currently the {{org.apache.aries.blueprint.compendium.cm.CmManagedServiceFactory}} lists the CM configurations and calls the {{updated}} method manually in the {{init}} method. But the method is called a second time by the configuration admin after service registration as specified. See attached patch to avoid the first {{updated}} call in the {{init}} method. I would also remove the mutex object which is locked during service registration but I am a little bit unsure to remove locks from code i didn't write ;) The patch works fine on our container (Felix 4.0.2, Blueprint 0.3.1, ConfigurationAdmin 1.2.8). I added two patches one for blueprint-cm 0.3.1 and for the current trunk.
                
> Blueprint Managed Service Factory Instantiates Duplicate Service
> ----------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>         Attachments: logs.txt, org.apache.aries.blueprint.cm-0.3.1.patch, org.apache.aries.blueprint.cm.patch-withtrunk.patch
>
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (ARIES-584) Blueprint Managed Service Factory Registers Duplicate Service

Posted by "Greg Rapp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998167#comment-12998167 ] 

Greg Rapp commented on ARIES-584:
---------------------------------

Bundle runtime details showing two services with the same factory PID - 

osgi> bundle 20
TestPlugin_1.0.0.qualifier [20]
  Id=20, Status=ACTIVE      Data Root=/Users/grapp/Documents/workspace-sts/.metadata/.plugins/org.eclipse.pde.core/Test/org.eclipse.osgi/bundles/20/data
  Registered Services
    {org.osgi.service.cm.ManagedServiceFactory}={Bundle-SymbolicName=TestPlugin, Bundle-Version=1.0.0.qualifier, service.pid=testfactory, service.id=44}
    {testplugin.ServerImpl}={service.ranking=0, service.pid=testfactory.daf5d806-19c9-4e64-b727-9c48789eaf99, service.id=45}
    {org.osgi.service.blueprint.container.BlueprintContainer}={osgi.blueprint.container.version=1.0.0.qualifier, osgi.blueprint.container.symbolicname=TestPlugin, service.id=46}
    {testplugin.ServerImpl}={service.ranking=0, service.pid=testfactory.daf5d806-19c9-4e64-b727-9c48789eaf99, service.id=47}
  No services in use.
  Exported packages
    testplugin; version="0.0.0"[exported]
    testplugin.api; version="0.0.0"[exported]
  Imported packages
    org.slf4j; version="1.6.1"<slf4j.api_1.6.1 [8]>
  No fragment bundles
  Named class space
    TestPlugin; bundle-version="1.0.0.qualifier"[provided]
  No required bundles

osgi> 

> Blueprint Managed Service Factory Registers Duplicate Service
> -------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (ARIES-584) Blueprint Managed Service Factory Registers Duplicate Service

Posted by "Greg Rapp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998166#comment-12998166 ] 

Greg Rapp commented on ARIES-584:
---------------------------------

Configuration List - 

cm list
Configuration list:
testfactory.daf5d806-19c9-4e64-b727-9c48789eaf99     initial@reference:file:../../../workspace-sts/TestPlugin/

osgi> cm getv testfactory.daf5d806-19c9-4e64-b727-9c48789eaf99

Configuration for service (pid) "testfactory.daf5d806-19c9-4e64-b727-9c48789eaf99"
(bundle location = initial@reference:file:../../../workspace-sts/TestPlugin/)

key                  value                                                  type
------               ------                                                 ------
service.pid          testfactory.daf5d806-19c9-4e64-b727-9c48789eaf99       java.lang.String
service.factoryPid   testfactory                                            java.lang.String

> Blueprint Managed Service Factory Registers Duplicate Service
> -------------------------------------------------------------
>
>                 Key: ARIES-584
>                 URL: https://issues.apache.org/jira/browse/ARIES-584
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.2, 0.3
>         Environment: Mac OSX 10.6.6 / Equinox 3.6.1 / Felix Config Admin 1.2.8 / Aries Blueprint 0.3 (and 0.2)
>            Reporter: Greg Rapp
>
> Creating a simple managed service factory, two services are instantiated for a single factory configuration.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira