Follow the instructions on building Cocoon as per the installation guide that comes with Cocoon. It can also be found here as well. Obviously since you have got the ZIP distribution you do not have to do the CVS bit thus you can start at the Building Apache Cocoon 2 section. Do each of the following steps:
- Set JAVA_HOME
- Create the WAR using
.\build.bat -Dinclude.webapp.libs=yes webapp
What this does is to create the web application and packaged cocoon.war under the {COCOON_HOME}/build/cocoon folder.
- Optionally make the SQL examples work out of the box. If you perform this step using
.\build.bat -Dinclude.webapp.libs=yes -Dinstall.war={{TOMCAT_HOME}\webapps} install
then it will basically copy the cocoon.war file across to the Tomcat webapps folder ready for immediate use.
- Add any additional components (I like FOP for example)
Next, copy the xerces_xxx.jar to {TOMCAT_HOME}\lib, delete the Tomcat jaxp jar and rename the parser.jar as instructed.
An important point is that if you are running Tomcat as an NT service then you will need to change {TOMCAT_HOME}\conf\wrapper.properties to reflect the classpath changes. Make sure xerces is first in line, remove (or comment out) the jaxp and rename the parser.jar reference. This is all done with the wrapper.class_path bit.
If you did run the second build.bat command above or if you copy cocoon.war into {TOMCAT_HOME}\webapps then you can check that C2 is working. Restart Tomcat and http://localhost:8080/cocoon should work. Note at this point Apache is doing nothing - Tomcat is doing the http serving. If there are any problems then check that the Tomcat classpath in wrapper.properties is correct and you have done the work in {TOMCAT_HOME}\lib as descibed above.
One other situation that came to light in C2 RC1 (and resolved in RC1a) was that the build file was including a reference to the LDAP transformer classes and since the JAR is not included then you would see an error when starting C2 along the lines of:
org.apache.cocoon.ProcessingException: Exception in Handler: org.apache.avalon.framework.component.ComponentException: Could not set up Component for hint: org\apache\cocoon\www\sitemap_xmap
This was resolved in C2 RC1a by making changing the offending include line in build.xml. Have a look and see. You will need to change this line if you want to use the LDAP transformer as per the instructions in the build.xml file.
One other good point about testing, especially if you are upgrading, is to delete the Cocoon working files in {TOMCAT_HOME}\work. If left in between upgrades, you can easily get precompiled code sent instead of the new pages being compiled and served.