Rookie error (i)--maven project deployment to JBoss appears: Failed to create a new SAX parser

Source: Internet
Author: User
Tags jboss

Today when debugging encountered a mistake, to the JBoss deploy directory when throwing the war package, reported a "Failed to create a new SAX parser" error. Find a solution on the internet, generally said that the project will be Xerces-2.6.2.jar and Xml-apis.jar package deleted, but I tried to delete or not, because in the packaging when Maven will still hit them into your war package.


First of all, my project uses the DWR,DWR default dependencies of these two packages, so the Pom file associates these two packages when you introduce DWR, so it's useless to remove them from the Lib Library of the project, because Maven will still be able to pull them in according to the dependencies in the Pom file when packing. The solution is simple, and the steps are as follows:


1, open the Pom file, click on the "Dependency Hierarchy" tab;

2, in the box above, enter the previous two package name respectively;

3, right-click the package and select the Exclude Maven artifactid option.


See figure below:



The pom file will then have a few more lines of code in the reference to DWR:

			<exclusions>
				<exclusion>
					<artifactId>xercesImpl</artifactId>
					<groupid >xerces</groupId>
				</exclusion>
				<exclusion>
					<artifactid>xml-apis</ artifactid>
					<groupId>xml-apis</groupId>
				</exclusion>
			</exclusions>

The idea is to eliminate the dependence on the two jars above. Then pack, deploy, and see the lovely successfully. Problem solved, and can be happy to write code to go, OH also.


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.