AnsweredAssumed Answered

unable to inject repository bean in java controller

Question asked by hemant1147 on Jan 27, 2015
Latest reply on Jan 28, 2015 by hemant1147
Hello Everyone,

I am new in alfresco world.
I am using aikau framework and instead of json model i am trying to use java backed controller for share web scripts .
In custom-slingshot-application-context.xml i am trying to inject repository bean. my code is

<bean id="webscript.com.example.pages.javadir.get"
      class="org.example.JavaDir" parent="webscript">   
  <property name="repository">
            <ref bean="repositoryHelper"/>
            </property>       
        </bean>

I having
javadir.get.html.ftl and
javadir.get.desc.xml inside site-webscripts/com/examples/pages


I am getting this exception
Error creating bean with name 'webscript.com.example.pages.javadir.get' defined in file [C:\Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco\web-extension\custom-slingshot-application-context.xml]: Cannot resolve reference to bean 'repositoryHelper' while setting bean property 'repository'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'repositoryHelper' is defined.

If i am executing this without injecting repository bean in controller then its running fine.

Outcomes