Home > error retrieving > error retrieving service from servicerecipe

error retrieving service from servicerecipe

ExportXMLWordPrintable Details Type: Bug Status: Closed Priority: Major Resolution: Done Affects Version/s: jboss-fuse-6.1 Fix Version/s: jboss-fuse-6.2 Component/s: Karaf Labels: None Description I am trying to use ServiceFactory in blueprint to register a service and here is what my blueprint looks like: Where HelloServiceFactory is an implementation of org.osgi.framework.ServiceFactory to provide a service HelloService: public class HelloServiceFactory implements ServiceFactory { @Override public HelloService getService(Bundle bundle, ServiceRegistration serviceRegistration) { return new HelloServiceImpl(bundle.getBundleId(), bundle.getSymbolicName()); } @Override public void ungetService(Bundle bundle, ServiceRegistration serviceRegistration, HelloService helloSrv) { } } And HelloService is a very simple interface: public interface HelloService { public String say(); } Obviously, HelloServiceImpl is an implementation of HelloService interface: public class HelloServiceImpl implements HelloService { … } However, above blueprint gives an error when deployed to JBoss Fuse 6.1 container: 09:19:08,035 | ERROR | l Console Thread | ServiceRecipe | 9 - org.apache.aries.blueprint.core - 1.0.1.redhat-610379 | Error retrieving service from ServiceRecipe[name='.component-1'] org.osgi.service.blueprint.container.ComponentDefinitionException: The service implementation does not implement the required interfaces: [org.jboss.fuse.servicefactory.HelloService] If I modify my blueprint a bit on the service definition by using "auto-export", it then works: