RESIN运行Tapestry发生错误解决方案及其他解决方法。

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值