AnsweredAssumed Answered

Web script classpath problem

Question asked by ruzeil on Oct 3, 2012
Latest reply on Oct 3, 2012 by abarisone
Hi

I'm pretty much new to Alfresco, so maybe this is a silly question, but still:

Using Alfresco version 4.0e.(Community edition).

Following the example of:
http://docs.alfresco.com/3.4/index.jsp?topic=%2Fcom.alfresco.Enterprise_3_4_0.doc%2Ftasks%2Fws-folderListing-Java-controller.html and
http://docs.alfresco.com/3.4/index.jsp?topic=%2Fcom.alfresco.Enterprise_3_4_0.doc%2Ftasks%2Fws-folderListing-Java-controller.html
I did everything step by step.
Script is registered, I can see it on http://localhost:8080/alfresco/service/index/all
But when calling the URL:
http://localhost:8080/alfresco/service/javadir/Company Home?verbose=true I get the following error:
Error during processing of the template 'Expression folder is undefined on line 3, column 21 in org/example/javadir.get.html.ftl.'. Please contact your system administrator.
So I've read that the class file can not be found (or the bean is not registered).
Now comes the gruesome part:
Searching (a thorough search of 2 days) I found 10 different examples where to put javadir-context.xml and JavaDir.class(or JavaDir.jar)
I)
Place the compiled Java class into the folder org/example in the web application classpath of the Alfresco content application server.
Place the Spring Framework configuration file into the extension classpath of the Alfresco content application server.
II)
1) put your class into a jar under alfresco classpath namely under tomcat/webapps/alfresco/WEB-INF/lib
2) put the javadir.desc.xml and javadir.get.html.ftl under tomcat/webapps/alfresco/extension/templates/webscripts
3) as stated by point 2.c) Place the Spring Framework configuration file into the extension classpath of the Alfresco content application server, so under tomcat/webapps/alfresco/extension
III)
.jar file in <tomcat>/webapps/share/WEB-INF/lib or .class files in <Alfresco>/tomcat/webapps/alfresco/WEB-INF/classes/<class folder structure>
web-scripts-application-context.xml - <tomcat>/webapps/share/WEB-INF/classes/org/springframework/extensions/webscripts
simple.get.desc.xml  - <tomcat>/webapps/share/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/demo

Tried like every possible example and nothing is working.

Can somebody please help me with the right paths?

Thanks in Advance

Best Regards
Aleksandar

Outcomes