Leszek Gawron wrote:
>
> Now I am using service-apples which for
>
> <map:call function="fetchDiscount"/> performs a call
> serviceManager.lookup( "fetchDiscount" )
>
> Now I see that 'fetchDiscount' bean is shown in cocoon log
> (pre-instantiating singletons yada yada yada) but I get the exception
> anyway:
>
> Message: Component with 'fetchDiscount' is not defined in this service
> manager. (Key='AvalonServiceManager')
>
> A simple test shows that ApplesProcessor is not properly contextualized:
> If I move the file from
> COB-INF/config/spring/applicationContext-apples.xml to
> META-INF/spring/applicationContext-apples.xml (so that this file ends up
> in WEB-INF/cocoon/spring/) everything starts working just fine.
>
I guess that this is the typical problem with hierarchical containers.
The apples processor is defined in the root application context and has
no access to any component in a child context. Moving your own
components to WEB-INF/cocoon/spring/ adds them in the root context and
therefore they are visible to apples.
Carsten
--
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/
|