1、
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:
<bean name="delegate" class="ro.nit.components.NitValidationDelegate" lifecycle="request" />
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:
./httpd.sh -classpath /${TOMCAT}/common/endorsed/xmlParserAPIs.jar:/${TOMCAT}/common/endorsed/xercesImpl.jar. 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:
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="http://caucho.com/ns/resin/core">
<!--
- Logging configuration for the JDK logging API.
-->
<log name='' level='info' path='stdout:' timestamp='[%H:%M:%S.%s] '/>
<log name='com.caucho.java' level='fine' path='stdout:'
timestamp='[%H:%M:%S.%s] '/>
<log name='com.caucho.loader' level='config' path='stdout:'
timestamp='[%H:%M:%S.%s] '/>
<system-property javax.xml.parsers.DocumentBuilderFactory=
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
<system-property javax.xml.parsers.SAXParserFactory=
"org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
This changed all XML parsers for resin to Xerces based ones. I used the Tomcat files which I copied to resin/lib.
2、
Tapesty每次改变页面文件,怎么不自动加载?
VM 里要加参数
-Dorg.apache.tapestry.enable-reset-service=true
-Dorg.apache.tapestry.disable-caching=true
set JAVA_OPTS = -Dorg.apache.tapestry.enable-reset-service=true -Dorg.apache.tapestry.disable-caching=true