cancel
Showing results for 
Search instead for 
Did you mean: 

unable to inject repository bean in java controller

hemant1147
Champ in-the-making
Champ in-the-making
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.
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
the repository bean does not exist in the share front end.   

hemant1147
Champ in-the-making
Champ in-the-making
Thanks for reply.

So is there any way to call Alfresco Java Api from share.
I am developing web scripts for share using aikau framework and i want java backed controller for that.