You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andreas Hartmann <an...@apache.org> on 2009/02/10 11:29:33 UTC

[2.2] Cannot resolve reference to bean SourceResolver in unit test

Hi Cocooners,

I'm trying to get some tests to run which rely on a components which 
uses the source resolver.

The component is declared in lenya-core-ac-components.xml as follows:

   <bean name="org.apache.lenya.ac.AccessControllerResolver"
     class="org.apache.lenya.cms.ac.PublicationAccessControllerResolver">
     <property name="sourceResolver" 
ref="org.apache.excalibur.source.SourceResolver"/>
     <property name="repository" 
ref="org.apache.lenya.cms.publication.Repository"/>
   </bean>

In my (TestClassName).spring.xml I reference the bean configuration file 
like this:

   <import 
resource="classpath:META-INF/cocoon/spring/lenya-core-ac-components.xml"/>

But I get the error

Cannot resolve reference to bean 
'org.apache.excalibur.source.SourceResolver' while setting bean property 
'sourceResolver'; nested exception is 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean 
named 'org.apache.excalibur.source.SourceResolver' is defined


Could this be a problem of a missing dependency? The 
cocoon-template-impl tests seem to rely on components which use the 
source resolver as well, and I couldn't find a difference in my 
configuration.

TALIA!

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [2.2] Cannot resolve reference to bean SourceResolver in unit test

Posted by Andreas Hartmann <an...@apache.org>.
Andreas Hartmann schrieb:
> Hi Cocooners,
> 
> I'm trying to get some tests to run which rely on a components which 
> uses the source resolver.
> 
> The component is declared in lenya-core-ac-components.xml as follows:
> 
>   <bean name="org.apache.lenya.ac.AccessControllerResolver"
>     class="org.apache.lenya.cms.ac.PublicationAccessControllerResolver">
>     <property name="sourceResolver" 
> ref="org.apache.excalibur.source.SourceResolver"/>
>     <property name="repository" 
> ref="org.apache.lenya.cms.publication.Repository"/>
>   </bean>
> 
> In my (TestClassName).spring.xml I reference the bean configuration file 
> like this:
> 
>   <import 
> resource="classpath:META-INF/cocoon/spring/lenya-core-ac-components.xml"/>
> 
> But I get the error
> 
> Cannot resolve reference to bean 
> 'org.apache.excalibur.source.SourceResolver' while setting bean property 
> 'sourceResolver'; nested exception is 
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean 
> named 'org.apache.excalibur.source.SourceResolver' is defined
> 
> 
> Could this be a problem of a missing dependency? The 
> cocoon-template-impl tests seem to rely on components which use the 
> source resolver as well, and I couldn't find a difference in my 
> configuration.

For the record, I "solved" it by adding an .xtest file with the 
declaration of the SourceResolver role and the required source 
factories. Isn't there a non-Avalon way to achieve this?

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org