Installing Tapestry applications in Resin

Created: 07-May-2004

Disclaimer: I wrote this document after loosing time trying to deploy
Tapestry applications with Resin. This document might not be complete
it only contains steps I took to assure that my application worked as
planed. This is not intended to be a complete solution for deploying Tapestry
applications on resin and completions are welcome.

application – The application was using Tapestry 3.0-beta4 and Hibernate
2.1.2 with an Oracle database. I wanted to deploy it on resin 3.0.6.

symthoms – Form validation did not worked, the delegate object seems
to be lost in space, several pages crashed without a reason

The problems seems to be related to the ones described on the Resin mailing
lists:

The first
solution consisted of adding the default values for the delegate:

<em><bean name="delegate" class="ro.nit.components.NitValidationDelegate"<strong>
lifecycle="request"</strong> /> </em>

Yet this only fixed the solution partialy and since I’ve had problems
with resin xml parsers before I tried running resin with a changed classpath
to add diferent xml parsers:

<em>./httpd.sh -classpath /${TOMCAT}/common/endorsed/xmlParserAPIs.jar:/${TOMCAT}/common/endorsed/xercesImpl.jar.</em>
This added Tomcat parsers before the default resin parsers. Note just
by adding the libs in the resin/lib does not fix the problem because of
resin classloader mechanism.

However I found this other resin interest archive which seemed to fix
everything.

http://www.caucho.com/quercus/faq/question.xtp?question_id=295

So I changed the resin.conf file:

<em><resin xmlns="http://caucho.com/ns/resin"<br></br>
xmlns:resin="http://caucho.com/ns/resin/core"><br></br>
<!--<br></br>
- Logging configuration for the JDK logging API.<br></br>
--><br></br>
<log name='' level='info' path='stdout:' timestamp='[%H:%M:%S.%s] '/><br></br>
<log name='com.caucho.java' level='fine' path='stdout:'<br></br>
timestamp='[%H:%M:%S.%s] '/><br></br>
<log name='com.caucho.loader' level='config' path='stdout:'<br></br>
timestamp='[%H:%M:%S.%s] '/><br></br><system-property javax.xml.parsers.DocumentBuilderFactory=<br></br>
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/><br></br>
<system-property javax.xml.parsers.SAXParserFactory=<br></br>
"org.apache.xerces.jaxp.SAXParserFactoryImpl"/></em>

This changed all XML parsers for resin to Xerces based ones. I used the
Tomcat files which I copied to resin/lib.