The Javax.xml.transform.TransformerFactoryConfigurationError Solution

Source: Internet
Author: User
Tags xml parser

The first step: To see Tomcat's WebApps, inside also deployed. Then use yesterday just learn a recruit will kill, hehe. To see the log under C:/Program files/apache Software foundation/tomcat 5.0/logs, Show Javax.xml.transform.TransformerFactoryConfigurationError Provider org.apache.xalan.processor.TransformerFactoryImpl not found later searched the Internet: found an article, said the problem is due to Tomcat C:/Program Files/apache Software Foundation/tomcat 5.0/common/endorsed The two XML jar files and the XML parser conflict in JDK: The original text is as follows: http://localhost:8080/ Testdwr/dwr access page Error 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. (domconverter.java:157) This is an XML parser problem, we can directly understand is that Transformerfactoryimpl can't find, then this class in which package? Xalan, go to the Apache online download to Xalan.jar packet thrown into the application of the Web-inf/lib directory, restart Tomcat can be OK. Above is the first solution. The problem is solved, but the root of it. Can't we use other XML parsers, and JDK and Tomcat aren't ready for us to have XML parsers available for DWR. Let's start with a background. JDK1.3 does not have an XML parser, all of which should be matched with Xercesimpl.jar and Xml-apis.jar Although JDK 1.4.0 and JDK 1.4.1However, with the XML parser, but some bugs, all have to put Xercesimpl.jar in the tomcat/common/endorsed directory to overwrite the default parser · The JDK 1.4.2 and later versions of the XML parser work well. Finally, the underlying cause of the error has to be followed by a slow way ... This means that JDK 1.4.2 and newer versions do not need Xercesimpl.jar and Xml-apis.jar help at all. As long as we are more careful we can find that there are two packages Xercesimpl.jar and Xml-apis.jar in the tomcat5.0.x/common/endorsed directory. Because the packages in the TOMCAT load endorsed are loaded by the parameter-djava.endorsed.dirs= "x:/tomcat5.0.x/common/endorsed", the packages placed in the endorsed directory are superior to JDK's Rt. Jar, so the XML parser using JDK must remove Xercesimpl.jar and Xml-apis.jar from the endorsed directory, which is the second solution. Think again, the question in the XML parser, why is Org.apache.xalan.processor.TransformerFactoryImpl such a class name. This makes me think about the differences between JDK 1.4 and JDK 1.5, and recall why the Tomcat 5.5.x version requires more than 1.5 versions of JDK. As an experiment, DWR 1.1.4 + JDK 1.4.2 + Tomcat 5.0.x,xercesimpl.jar and Xml-apis.jar still keep them in the endorsed directory, running the most basic DWR program without a problem. Then why do you have to change the JDK again? The reason is that the Transformerfactory implementation class full name, Org.apache.xalan.processor.TransformerFactoryImpl, is specified in Xml-apis.jar, which exists in the JDK 1.4.2 Rt.jar package, and in the JDK 1.5 Rt.jar package There is no Apache package, so it does not, and further, in fact, the second solution if using JDK 1.5 version only need to put the Xml-apis.jar package from Endorsed directory to move out on the line. I follow the introduction of the second method, delete the endorsed below the two jar files, restart Tomcat, view the log, did not report the above error, but a run, still can't show the project.   The second step: View the console console myeclipse, found that there is serious: error Filterstart online check: The original is as follows: The recent use of Tomcat 5.5, but this thing when you need most, often make you very disappointed. Reason code to submit to CVS, delete some of the tests used by the class and the paging file, just ignored to comment out the deleted class in struts.xml action mapping. Immediately following the restart of Tomcat, only the site was inaccessible and a careful look at the Tomcat 5.5 log found: critical: Error filterstart information, then check the initialization Struts2 filter and initialize the corresponding servlet- Api.jar, no problem found. Finally, there is no way to use Tomcat 6 directly, and the exception it throws at startup tells me that I can't load Java classes configured in Struts.xml. At this time, I understand, the original problem. Once the class configured by the Struts.xml file does not exist when initialized, the entire site is inaccessible. The final lesson, once the class is configured in Struts.xml, if lost, will affect the entire site's operation. Suggest you can directly put the site directly under Tocmat 6, used to replace Tomat 5.5. The error log for Tomcat 5.5 is so chilling. ~ "The exception that was thrown at startup tells me that I can't load Java classes configured in Struts.xml" This is the key, it is very clear that the Java class is not found, in my program is loginaction this class, How can not find it, on the Struts.xml file a look, God, it should be class= "com.test.action.LoginAction", and I wrote is "Com.test.LoginAction", after the rehabilitation, to run, so ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.