You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Valentin Mahrwald (JIRA)" <ji...@apache.org> on 2010/04/17 10:05:24 UTC

[jira] Commented: (ARIES-288) reference in argument doesn't work

    [ https://issues.apache.org/jira/browse/ARIES-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12858109#action_12858109 ] 

Valentin Mahrwald commented on ARIES-288:
-----------------------------------------

I have tried to reproduce the problem and failed :( The following worked for me

    <bean id="serviceArgBean" class="org.apache.aries.blueprint.sample.ServiceArgBean" activation="eager"
      init-method="start" destroy-method="stop">
      <argument>
        <reference interface="org.osgi.service.packageadmin.PackageAdmin" />
      </argument>
    </bean>

It also worked when replacing PackageAdmin with a custom service and making sure it only becomes available after the blueprint. 

Have you got a stack trace for when it fails? And where is the service registered in the same bundle or (in)dependent bundle ?

> reference in argument doesn't work
> ----------------------------------
>
>                 Key: ARIES-288
>                 URL: https://issues.apache.org/jira/browse/ARIES-288
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: 0.1
>            Reporter: David Jencks
>
> This doesn't work:
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>    <bean class="org.apache.yoko.osgi.locator.ServiceBean"
>          activation="eager"
>          init-method="start"
>          destroy-method="stop">
>        <argument>
>            <reference interface="org.apache.yoko.osgi.locator.Register" component-name="yokoRegistryBean"/>
>        </argument>
>    </bean>
> ...
> You have to make the reference top level and use a ref to it:
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>    <reference id="register" interface="org.apache.yoko.osgi.locator.Register" component-name="yokoRegistryBean"/>
>    <bean class="org.apache.yoko.osgi.locator.ServiceBean"
>          activation="eager"
>          init-method="start"
>          destroy-method="stop">
>        <argument>
>            <ref component-id="register"/>
>        </argument>
>    </bean>
> ...

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