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

Tuomas Kiviaho commented on FELIX-2875:
---------------------------------------

setService(String filter) seems to be setting the missing service class as 
Object and by default having on both auto config and required causes the 
following

ERROR: Could not create null object for class java.lang.Object. 
(java.lang.IllegalArgumentException: java.lang.Object is not an interface)
java.lang.IllegalArgumentException: java.lang.Object is not an interface
        at java.lang.reflect.Proxy.getProxyClass(Proxy.java:382)
        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:601)
        at 
org.apache.felix.dm.impl.dependencies.ServiceDependencyImpl.getNullObject(ServiceDependencyImpl.java:355)
        at 
org.apache.felix.dm.impl.dependencies.ServiceDependencyImpl.lookupService(ServiceDependencyImpl.java:303)
        at 
org.apache.felix.dm.impl.dependencies.ServiceDependencyImpl.getAutoConfigInstance(ServiceDependencyImpl.java:842)
        at 
org.apache.felix.dm.impl.ComponentImpl.configureServices(ComponentImpl.java:987)

I've also managed to use it several times to provide the service interface as 
class name due to old habits so I just wanted to raise a question whether or 
not this particular syntactic sugar could be deprecated.
                
> Improve the setService() methods in the ServiceDependencyImpl to allow null 
> for the service name.
> -------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-2875
>                 URL: https://issues.apache.org/jira/browse/FELIX-2875
>             Project: Felix
>          Issue Type: Improvement
>          Components: Dependency Manager
>            Reporter: Marcel Offermans
>            Assignee: Marcel Offermans
>
> The setService() methods are currently a bit more strict than necessary, not 
> allowing you to, for example, specify only a filter condition via the method 
> called setService(Class name, String filter). This in turn limits the options 
> you have when creating adapters. Fix this problem and factor out any 
> redundant code in these methods.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to