cancel
Showing results for 
Search instead for 
Did you mean: 

Web script classpath problem

ruzeil
Champ in-the-making
Champ in-the-making
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-folde... and
http://docs.alfresco.com/3.4/index.jsp?topic=%2Fcom.alfresco.Enterprise_3_4_0.doc%2Ftasks%2Fws-folde...
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
3 REPLIES 3

abarisone
Star Contributor
Star Contributor
Hi,
take a look to this topic https://forums.alfresco.com/en/viewtopic.php?f=53&t=44976

Regards,
Andrea

ruzeil
Champ in-the-making
Champ in-the-making
Hi

I forgot to copy/paste that:
/alfresco-4.0.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension
If I put javadir-context.xml in extension folder tomcat is not starting.

Let me go step by step:
1) Make javadir.desc.xml and javadir.get.html.ftl on Alfresco Explorer. Script is shown in WebScripts. is This OK? (I presume this files are in the Repository, since i can no find them on disk)
2) Make JavaDir.jar (or .class) and put it  tomcat/webapps/alfresco/WEB-INF/lib is This OK?
3) make java-context and put it in /alfresco-4.0.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension. Is this OK?

I tried this,and it's not working but at least please verify this steps

Thanks

Best Regards
Aleksandar

abarisone
Star Contributor
Star Contributor
1) Make javadir.desc.xml and javadir.get.html.ftl on Alfresco Explorer. Script is shown in WebScripts. is This OK? (I presume this files are in the Repository, since i can no find them on disk)
You'd better put these files under
/alfresco-4.0.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension

Take a look to these resources:
http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples#The_Demo_Web_Scripts
http://code.google.com/p/alfresco-java-backed-webscripts-demo/

Regards,
Andrea