Installing Lenya on Resin 2.x branch (Resin 2.0.4+)

  1. Follow Steps 1-6 of the standard installation, then follow the steps below. I'll assume you downloaded the Lenya source to /usr/local/lenya. I'll call this directory $LENYA_HOME for shorthand.

2. Configure Lenya:

To install Lenya with Resin, you need to edit your build properties. To do this, copy $LENYA_HOME/build.properties to $LENYA_HOME/local.build.properties.

Edit local.build.properties. For the described configuration the following settings will work (MS Windows: Don't use backslashes "\" for directory separation.) Although the Lenya properties file uses variable names specific to Tomcat, we'll ignore the name and use variables specific to Resin instead. Replace $RESIN_WEB_HOME with your Resin directory (the directory containing your Resin webapps and web files).

Edit the following parameters in your local.build.properties:

  • cocoon.src.dir=$LENYA_HOME/cocoon-2.1.5.1
  • tomcat.home.dir=$RESIN_WEB_HOME
  • tomcat.cache.dir=${tomcat.home.dir}/WEB-INF/work/lenya
  • tomcat.webapps.dir=${tomcat.home.dir}/webapps/lenya
  • tomcat.endorsed.dir=${tomcat.webapps.dir}/WEB-INF/lib

3. Build Lenya: ant webapp 4. Copy the Lenya WAR file to your webapps directory. (usually $RESIN_HOME/webapps) 5. Add the Lenya web-app to resin.conf:

<web-app id="/lenya">
<app-dir>$RESIN_HOME/webapps/lenya</app-dir>
<!-- enable precidence of xerces and xsl processors-->
<servlet-classloader-hack>true</servlet-classloader-hack>
</web-app>

(TODO) - using the servlet-classloader-hack is discouraged by Resin, but needed to run Lenya under Resin 2.x. However, an alternate way of specifiying xml processors exists (started below). This is not complete but encouraged to play with:

<web-app id="/lenya">
<app-dir>$RESIN_HOME/webapps/lenya</app-dir>
<classpath id="WEB-INF/lib/xml-apis.jar" compile="false" />
<classpath id="WEB-INF/lib/xercesImpl-2.6.2.jar" compile="false" />
<classpath id="WEB-INF/lib/xalan-2.6.0.jar" compile="false" />

<!-- override default sax, dom and trax processors with xerces (needed by Cocoon)-->
<system-property javax.xml.parsers.SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl" />
<system-property javax.xml.parsers.DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl" />
<system-property javax.xml.transform.TransformerFactory = "org.apache.xalan.processor.TransformerFactoryImpl"/>
<system-property org.xml.sax.driver = "org.apache.xerces.parsers.SAXParser"/>
</web-app>

6. Start Resin.

  • No labels