camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quinn Stevenson <>
Subject Re: CamelBlueprintTestSupport No bean could be found in the registry
Date Thu, 04 Feb 2016 22:33:01 GMT
I would assume that MyServiceInterface is in one bundle, and you have another bundle with a
private class implementing the interface and exposing that implementation as a service.  If
that is correct, then I normally create a stub for the service in my src/test/java/…../
and register and instance of that class as a service for the MyServiceInterface interface.

If the implementation of the service is in the same bundle as MyServiceInterface, and that
bundle exposes the implementation as a service, then having a dependency on that bundle should
be sufficient.

If the implementation of the service is in a different bundle and you want to use that implementation,
again, add a <scope>test</scope> dependency and the service should be available
for you - you wouldn’t need addServicesOnStartup in either of these last two situations.

Generate a sample project using camel-archetype-blueprint v2.16.2 and see what it does - that
should help.

> On Feb 4, 2016, at 2:27 PM, enigma <> wrote:
> I have to register OSGI reference present in the blueprint xml file. It is an
> interface class. So, in the following statement MySerivceInterface is the
> OSGI reference which is present in a different OSGI bundle. In the above
> reply it is metioned as TestStubServiceImpl need to be passed to asService()
> method. What is this TestStubServiceImpl ? How can we add the reference of
> MySerivceInterface OSGI bundle to the asService method call ?
> services.put(MySerivceInterface.class.getName(), asService(new
> TestStubServiceImpl(), null)); 
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

View raw message