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.