Xerces JAR on GAE project's classpath leads to

2019-05-21 03:06发布

问题:

I'm using the Eclipse plugin for Google App Engine and I'm having a strange issue with a Xerces dependency. On of my classes depends on the Apache Xerces JAR which I have added to the project's classpath. This however, triggers an error when starting the Jetty app server:

WARNING: failed 
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext@6efde050 
{/,/Users/lenni/dev/gate/war} 
javax.xml.parsers.FactoryConfigurationError: Provider 
org.apache.xerces.jaxp.SAXParserFactoryImpl not found 

When I remove the xercesImpl.jar from my classpath jetty starts fine, however then my classes don't compile anymore since the dependency is missing.

This very much sound like this issue, however I tried switching to JRE 1.6 and still no joy.

回答1:

This appears to relate to Issue 1367 in the GAE/J buglist. Comments 15, 16, and 17 seem to indicate a workaround.



回答2:

Take a look at Trouble with Selenium (XercesImpl) and Google App Engine. I had a similar problem with GAE (SAXParserFactoyImpl not found) and solved it by;

  1. Importing the jar to war/WEB-INF/lib
  2. Adding the jar to the build path