问题描述:解决关于在jdk1.4下处理xml文件转移到jdk1.5下出现的问题
错误消息:
500 Servlet Exception
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl
not found
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
at net.seave.pub.tools.PubTools.viewPage(PubTools.java:241)
at net.seave.systemManage.login.Login.doPost(Login.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
at net.seave.systemManage.pub.EncodeFilter.doFilter(EncodeFilter.java:77)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
at net.seave.systemManage.pub.CheckValidUserFilter.doFilter(CheckValidUserFilter.java:135)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
at com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:419)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:389)
at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:492)
at com.caucho.util.ThreadPool.run(ThreadPool.java:425)
at java.lang.Thread.run(Thread.java:595)
--------------------------------------------------------------------------------
Resin-3.0.18 (built Fri, 24 Feb 2006 02:47:03 PST)
解决方法:
把$TOMCAT_HOME/common/endorsed目录下的xercesImpl.jar,xml-apis.jar文件拷贝到当前应用系统的WEB-INF/lib目录
并在对应的
TransformerFactory tFactory = TransformerFactory.newInstance();
代码前加
System.setProperty("javax.xml.transform.TransformerFactory", "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");