I have a non-SDK development environment of Alfresco 4.2.c set up in Eclipse using Alfresco Maven. My main goal is to familiarise myself with Share development, content models, and web scripts for the upcoming project.
The second part of the web script tutorial requires downloading and running the code created by the author. I downloaded the code and put everything from <em>src/</em> directory into my <em>src/main/resources/</em> directory. (I'm not sure where the <em>web/</em> directory should go, but I don't think it matters for getting <em>src/</em> to run).
There are several things about the sample code.
- It is meant to be built with ant. There are <em>build.properties</em> and <em>build.xml</em>.
- The tutorial is dated at 2007, nearly 6 years old now
When I restart Alfresco Tomcat, I get an error: <em> SEVERE: Exception sending context initialized event to listener instance of class org.alfresco.web.app.ContextListener
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.someco.scripts.PostRating] for bean with name 'webscript.com.someco.ratings.rating.post' defined in file [/home/alexk/workspace/cabnet-alfresco/alfresco/target/alfresco/WEB-INF/classes/alfresco/extension/someco-scripts-context.xml]; nested exception is java.lang.ClassNotFoundException: com.someco.scripts.PostRating </em>
I've checked and the code is there in those files with those class names. Being both Alfresco and Maven nubie I thought that this code should just run. Evidently some more config needs to be included.
Does anyone know how to get this code running in Maven Alfresco 4.2.c?
P.S. If anyone knows other more current Alfresco (escpeically Share) tutorials I would be very interested.
Hi, your webscript class must be in the classpath and check if the Spring's configuration of your script is correct. Moreover if the webscript is Java-backed, remember that if you put it in some package its Spring class definition must reflect that.