===================================================== HOW-TO: Deploying the Cocoon-2.0.1 example within BES =====================================================
By following these steps, *most* of the cocoon demo webapp site should work. 1) Unpack the cocoon.war file into a working directory (<work_dir>). 2) Open the <work_dir>/WEB-INF/web.xml file and change <servlet-class>org.apache.cocoon.servlet.CocoonServlet</servlet-class> to <servlet-class>org.apache.cocoon.servlet.ParanoidCocoonServlet</servlet-class> 3) Within the same file, insert the following after the servlet-class definition: <init-param> <param-name>lib-dir</param-name> <param-value>absolute_path_to_lib_dir</param-value> </init-param> where "absolute_path_to_lib_dir" could be: <work_dir>\WEB-INF\lib. This directory *has* to contain the unpacked jars found within the war file. 4) Unpack the <work_dir>\WEB-INF\lib\cocoon-2.0.1.jar into a temporary directory. - In order to get most of the site to work, replace the org/apache/cocoon/environment/AbstractEnvironment.class file with the supplied patch. - In order to get internationalization to work, also replace the org/apache/cocoon/transformation/I18nTransformer.class with the supplied patch. 5) Re-jar the modified cocoon-2.0.1 files, and replace the <work_dir>\WEB-INF\lib\cocoon-2.0.1.jar with the new one. 6) Re-war the files in <work_dir>, and deploy the resulting package. Do *not* delete <work_dir> as it now contains the required jar directory (unless you specified another directory). ================= Patch Description ================= org/apache/cocoon/environment/AbstractEnvironment ------------------------------------------------- The following code was added within the changeContext(String, String) method at line 216: //if the resource is jndi reference (e.g. BES temp deployment) } else if (this.context.getProtocol().equals("jndi")) { String fullContext = this.context.toString() + newContext; if (!fullContext.endsWith("/")) { fullContext = fullContext.substring(0, fullContext.lastIndexOf('/') + 1); } this.context = new URL(fullContext); org/apache/cocoon/transformation/I18nTransformer ------------------------------------------------ Lines 789-793 were commented out within the _setup(SourceResolver, String) method: //if (!systemId.startsWith(FILE)) { // throw new ResourceNotFoundException( // systemId + " does not denote a directory" // ); //} ====== Theory ====== Cocoon seems to have been designed in order to use conventional file system structures. BES, on the other hand, uses jndi URL references almost exclusively. Problems are bound to occur, but should be solvable on a case-by-case bases. For now, I have done the strict minimum, but I would be happy to post updates as they become available. Good luck, and keep up the great work! -- --------------------- Terence JACYNO Galasoft Inc.
BESPatch.zip
Description: application/compressed
--------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>