发布我的webapp的时候遇到了下面的错误信息。
org.xml.sax.SAXNotRecognizedException:
http://xml.org/sax/features/validation
查找资料
http://www.google.com/search?hl=zh-CN&inlang=zh-CN&newwindow=1&q=resin+org.xml.sax.SAXNotRecognizedException&lr=,(参考:
http://www.slamb.org/svn/repos/projects/axamol/sax-pipeline/README)
需要新建一个 jaxp.properties, 内容如下:
javax.xml.parsers.SAXParserFactory: org.apache.xerces.jaxp.SAXParserFactoryImpl
保存文件到$JAVA_HOME/jre/lib/下面
接下来可能会出现下面的错误信息:
javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAX
ParserFactoryImpl could not be instantiated: java.lang.NullPointerException
ParserFactoryImpl could not be instantiated: java.lang.NullPointerException
因此还需要把xercesImpl.jar复制到D:\jdk1.5.0_01\jre\lib\endorsed下面(没有这个目录就创建这个目录)
重新启动resin,我的webapp启动成功了。
访问
http://lizongbo.myresintest.com/mywebapp/,页面正常出现。
b.另外一种更简单的解决方法,不需要修改jdk的配置
(
此方法经过测试可以,请参考
http://www-900.ibm.com/developerWorks/cn/webservices/ws-axisfaq/index.shtml和
http://www.caucho.com/quercus/faq/question.xtp?question_id=295)):
<host id="lizongbo.myresintest.com" root-directory=".">
<web-app id='/' document-directory="webapps/ROOT"/>
<web-app id='/lizongbo' document-directory="E:/jb/oscachedemo/test">
<web-app id='/' document-directory="webapps/ROOT"/>
<web-app id='/lizongbo' document-directory="E:/jb/oscachedemo/test">
<system-property javax.xml.transform.TransformerFactory="org.apache.xalan.processor.TransformerFactoryImpl"/>
<system-property javax.xml.parsers.DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
<system-property javax.xml.parsers.SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
<system-property org.xml.sax.driver="org.apache.xerces.parsers.SAXParser"/>
<system-property javax.xml.parsers.DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
<system-property javax.xml.parsers.SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
<system-property org.xml.sax.driver="org.apache.xerces.parsers.SAXParser"/>
</web-app>
</host>
</host>