Thanks! I also just found another workaround: pretend the service is an
"external service", that is, write 

> planetService instead of > @PlanetService

Then I can provide my own setter and it works.


Patrik Nordwall wrote:
> 
> Right now you can only inject repositories and external beans, not other
> services.
> http://www.fornax-platform.org/tracker/browse/CSC-189
> 
> However, the workaround is easy (but ugly).
> Add a method that delegates to the service. It can be protected to avoid
> visibility in public api.
> 
>         Service PlanetService {
>             protected injectionDummy => @AnotherService.dummy;
>             String sayHello(String planetName) throws
> PlanetNotFoundException;
>             protected findByExample => PlanetRepository.findByExample;
>             @Planet getPlanet(String planetName) throws
> PlanetNotFoundException;
>         }
> 
>         Service AnotherService {
>                 void dummy();
>         }
> 
> /Patrik
> 
> 
> Bjoern_G wrote:
>> 
>> I can't get Services from other Modules injected, any ideas what could be
>> wrong? The Service I want to inject is not generated into the
>> ServiceBaseImpl, and it also doesn't show up in the Services-....xml (so
>> the problem is not that I should provide the setter myself, as for
>> "external" services).
>> 
>> I have tried it several times with different services.
>> 
>> using > @ServiceName as usual.
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Injection-of-Service-from-other-Module-doesn%27t-work--tp18066885s17564p18086236.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to