[ 
https://issues.apache.org/jira/browse/FELIX-6420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17355278#comment-17355278
 ] 

Stefan Bischof commented on FELIX-6420:
---------------------------------------

i had a typo when updating to newest scr.
2.1.26 ( I updated to 2.1.16)
fixed with:
https://github.com/apache/felix-dev/commit/d9236c80a4592a1e2b172fc330115b39bee3dc02

> Injection of unbound optional References in Constructor:
> --------------------------------------------------------
>
>                 Key: FELIX-6420
>                 URL: https://issues.apache.org/jira/browse/FELIX-6420
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-2.1.8, scr-2.1.26
>            Reporter: Stefan Bischof
>            Priority: Major
>
> OSGi-Spec:
> {code:java}
> If the constructor parameter is associated with a reference having 
> cardinality of 0..1 and there is no bound service for the reference, then the 
> value null will be supplied as the constructor parameter. 
> {code}
>  
> {{}}
> {{when trying with Felix-SCR i got this Exception:}}
> {{}}
> {code:java}
> java.lang.InstantiationException: Unable to get service for reference 
> optionalNull
>       at 
> org.apache.felix.scr.impl.inject.internal.ComponentConstructorImpl.newInstance(ComponentConstructorImpl.java:301)
>       at 
> org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:279)
>       at 
> org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:115)
>       at 
> org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:984)
>       at 
> org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:957)
>       at 
> org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:902)
>       at o
> {code}
> {{You can test it with this test in the PR to the ds-tck:}}
> [https://github.com/osgi/osgi/pull/230
> ]{{}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to