Running the WCM example on Tomcat 6.0.x
Mike Sciabarra, Consultant, Tuesday 16th March 2010
If you try to deploy the example for the alfresco WCM contained in the alfresco-wcm-example-3.2.0 in a Tomcat 6.0.x servlet container, you will have a number of issues. Put simply, it does not work as it is most likely because it was built for a previous version of Tomcat
Because this example is a valuable and reusable starting point for any WCM project using the FSR, it is worth the effort to fix it.
Furthermore, is it not a bad idea to understand what happened here.
So, let's grab the alfresco-sample-website.war, from the alfresco wcm examples, unzip it in a directory and start to fix it.
The first problem you will incur is: pages are not served (instead you get a generic tomcat error).
If you look into the logs; the below error will appear:
java.lang.SecurityException: Filter of class org.apache.catalina.ssi.SSIFilter is privileged and cannot be loaded by this web application
The problem here is that the SSi filter is now protected, so to use it you need to give "super power" to your application.
This can be done in a number of ways, but the simpler is to put into the folder META-INF a file "context.xml" with this content.
docBase="webapps/ROOT"
<Context path="/"
antiResourceLocking="false"
privileged="true"/>
</Context>
Privileged=true is the key. Also note I am assuming that the example will be deployed as the root context and deployed as ROOT.war. Change accordingly if your choice is of the ROOT context is different.
The second problem you may face is the following error when you access some pages (most notably those using the custom tags defined with the prefix pr:)
org.apache.jasper.JasperException: An exception occurred processing JSP page /media/releases/index.jsp at line 74
The real problem is actually this:
java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
So grab the common-logging-1.1.jar from somewhere (for example from <ALFRESCO_ROOT>/tomcat/webapps/alfresco/WEB-INF/lib) and copy it under the lib directory of your tomcat.
Ok you may hope you are done. Actually if you bundle the war with those fix and run it, it works. Well, almost.
For most uses, it is enough. The news page is not working, however. This is because the example defines a tag library that refers to some Alfresco API.
The final fix is to copy all the 3 virtual-tomcat/lib/alfresco-*.jar in your final deployment. And you are done.







Comments
Be the first to comment.
Add your comment