java.lang.NoSuchMethodError: org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar

今天在服务器部署的时候,发生了这个问题,明明在本机上使用的时候,没有发生错误,但是发布到服务器上的时候却发生了这个错误,百度了好久,发现遇到这个问题的人很多,但是却没有一个比较满意的答案,后来还是通过谷歌到答案的,出现这个问题的原因是架包冲突的问题,下面是我查到的回答:

You're probably picking up an incompatible mix of classes from Xerces 2.8.1 and some old version of Xerces (something prior to 2.7.0) which is somewhere on your classpath or perhaps in the endorsed directory of your JDK 1.4 installation.

  ,后来我去我项目上仔细查看,发现真的是这样,lib包下面有Xerces 2.8.1和Xerces2.6.x,后来我把2.6的那个架包给删除了,就没出现问题了。因为怕以后出现这个问题不知道怎么解决,所以记一下

原文地址:https://www.cnblogs.com/zr520/p/5046580.html