在tomcat5.0.28下配置DWR出错
2008-02-23 09:18:48来源:互联网 阅读 ()
今天学习DWR,根据官方网上的资料,直接下载了dwr.war进行测试,但是报下面的错误:
Javax.XML.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found javax.xml.transform.TransformerFactory.newInstance(Unknown Source) uk.ltd.getahead.dwr.convert.DOMConverter.<init>(DOMConverter.java:157) sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) java.lang.reflect.Constructor.newInstance(Constructor.java:494) java.lang.Class.newInstance0(Class.java:350) java.lang.Class.newInstance(Class.java:303) uk.ltd.getahead.dwr.impl.DefaultConverterManager.addConverterType(DefaultConverterManager.java:54) uk.ltd.getahead.dwr.impl.DefaultConfiguration.loadConverter(DefaultConfiguration.java:165) uk.ltd.getahead.dwr.impl.DefaultConfiguration.loadInits(DefaultConfiguration.java:119) uk.ltd.getahead.dwr.impl.DefaultConfiguration.addConfig(DefaultConfiguration.java:86) uk.ltd.getahead.dwr.impl.DefaultConfiguration.addConfig(DefaultConfiguration.java:66) uk.ltd.getahead.dwr.AbstractDWRServlet.init(AbstractDWRServlet.java:110) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) java.lang.Thread.run(Thread.java:595)
马上去官方网站(http://getahead.ltd.uk/dwr/getstarted)找答案:官方网站给出的是
What if it doesn't work?
The most common error is an XML parser error. It has nothing to do with DWR, and is due to your installation of Tomcat having Xerces installed when it shouldn't or not installed when it should.
- JDK 1.3 didn't come with an XML parser, so you will need xercesImpl.jar and xml-apis.jar for that case.
- JDK 1.4.0 and JDK 1.4.1 did come with an XML parser but it was buggy so you may need to override the default by putting xercesImpl.jar into the tomcat\common\endorsed directory.
- JDK 1.4.2 and JDK 5 come with a fully working XML parser and you shouldn't need one at all.
按照他们的说法,JDK 1.4.2 and JDK 5根本就不要改什么东西就可以的呀?但为了保险起见,还是将tomcat\common\endorsed下的xercesImpl.jar 和xml-apis.jar换成了最新版的。
再次启动,还是报一样错误。没办法。仔细分析一下错误信息,有这么一句话:
Provider org.apache.xalan.processor.TransformerFactoryImpl not found
也就是这个类所在包找不到,经过一番努力,终于知道org.apache.xalan.processor.TransformerFactoryImpl 是在xnlan.jar里面。于是将xalan.jar拷贝到Webapps\dwr\WEB-INF\lib下。
重新启动tomcat
终于搞定!
上一篇: 用javascript 自动调节iframe高度出现问题
下一篇: Java 作业--试验一 金额的中文大写方式
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash