You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Bruno Dumon <br...@outerthought.org> on 2006/09/06 22:39:02 UTC
Re: Apples + spring = cannot find beans (AvalonServiceManager
exception)
On Wed, 2006-09-06 at 16:00 +0200, Leszek Gawron wrote:
> 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.
In Cocoon 2.1.9 there was a similar issue:
https://issues.apache.org/jira/browse/COCOON-1728
though I don't know how much that applies to trunk.
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org