[
https://issues.apache.org/jira/browse/ARIES-1065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13654430#comment-13654430
]
Simon Gormley commented on ARIES-1065:
--------------------------------------
Hi Stephan,
The patches we've provided are quite similar. However, I've tried out the patch
in ARIES-1063, and found that the forced adding of the ServiceFactory to the
proxy:
cls.add(blueprintContainer.loadClass("org.osgi.framework.ServiceFactory"));
is necessary, otherwise the application's ServiceFactory.getService method is
not called as expected.
So, I'd be happy if we combine the fixes, as the other difference is the guard
against validating the ServiceFactory if an UnwrapperedBeanHolder isn't in use,
which makes sense to me.
Simon
> Blueprint - ServiceFactory can't be specified as the bean class
> ---------------------------------------------------------------
>
> Key: ARIES-1065
> URL: https://issues.apache.org/jira/browse/ARIES-1065
> Project: Aries
> Issue Type: Bug
> Components: Blueprint
> Reporter: Simon Gormley
> Attachments: blueprint_servicefactory.patch
>
>
> Specifying a class that implements org.osgi.framework.ServiceFactory as the
> bean class causes an error indicating that the class does not implement the
> specified interfaces.
> e.g. a blueprint.xml containing:
> <?xml version="1.0" encoding="UTF-8"?>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
> <bean id="MyServiceImplBean" class="com.code.impl.MyServiceFactory"/>
> <service ref="MyServiceImplBean" id="MyServiceImplBeanService"
> interface="com.code.api.MyServiceInterface"></service>
> </blueprint>
> Where MyServiceFactory implements ServiceFactory and can be used to obtain
> the actual service class that implements the MyServiceInterface would cause
> an error indicating that MyServiceFactory does not implement
> MyServiceInterface (which is true)
> Suggested fix (patch attached) is to ensure for this case that the proxy
> class indicates it implements the ServiceFactory interface, and then delay
> validation until after the service is obtained.
--
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