cancel
Showing results for 
Search instead for 
Did you mean: 

No bean named 'webscripts.repo'

slothrop
Champ in-the-making
Champ in-the-making
I was working on a Java-based web script patterned after the example I downloaded off the web site called, "Java-backed web script example."  This gave me an error when I switched to version 3.0, added it to the war file and started the server. 

In the module-context file for that example there is the following:
<bean id="webscript.org.alfresco.demo.random.get" class="org.alfresco.module.demoscripts.RandomSelectWebScript" parent="webscript">
      <property name="repository" ref="webscripts.repo" />
      <property name="services" ref="ServiceRegistry" />
   </bean>

RandomSelectWebScript inherits from AbstractRepositoryWebScript which contains a field, repository, of type org.alfresco.repo.web.scripts.Repository in v2.9.  In 3.0 there is no class called org.alfresco.repo.web.scripts.Repository.  The class org.alfresco.repo.model.Repository in v3.0  has the necessary methods and allows the class to compile but I guess it isn't defined as a bean.  The error is:
Cannot resolve reference to bean 'webscripts.repo' while setting bean property 'repository'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'webscripts.repo' is defined
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'webscripts.repo' is defined

What is the best way to deal with this?
1 REPLY 1

slothrop
Champ in-the-making
Champ in-the-making
It looks like I fixed this by changing
<property name="repository" ref="webscripts.repo" />
to
<property name="repository" ref="repositoryHelper" />
in the module-context.xml file.