cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Apples + spring = cannot find beans (AvalonServiceManager exception)
Date Wed, 06 Sep 2006 14:00:45 GMT
I have a development block that has a following application context 
defined at COB-INF/config/spring/:

> <beans>
>   <bean id="fetchDiscount" class="com.mobilebox.mkupon.apples.FetchDiscountApple"
autowire="byName">
>     <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
>   </bean>
>   <bean id="createCoupon" class="com.mobilebox.mkupon.apples.CreateCouponApple" autowire="byName"/>
>   <bean id="fetchDiscountFromUrl" class="com.mobilebox.mkupon.apples.FetchDiscountFromUrlApple"
autowire="byName"/>
>   <bean id="listCoupons" class="com.mobilebox.mkupon.apples.ListCouponsApple" autowire="byName"/>
>   <bean id="registerTerminal" class="com.mobilebox.mkupon.apples.RegisterTerminalApple"
autowire="byName"/>
>   <bean id="resetCoupon" class="com.mobilebox.mkupon.apples.ResetCouponApple" autowire="byName"/>
>   <bean id="tobaccoReport" class="com.mobilebox.mkupon.apples.TobaccoReportApple"
autowire="byName"/>
> </beans>

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.

-- 
Leszek Gawron, IT Manager                          MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message