Java – org.apache.xerces.jaxp.SAXParserFactoryImpl not found when importing Gears API in GWT

gwtjavaxerces

I've created a GWT project using Eclipse which was working perfectly (I was able to run it in both Hosted Mode and on Google App Engine) until I tried to import the Gears API for Google Web Toolkit. After adding the following line to my java source file:

import com.google.gwt.gears.client.geolocation.Geolocation;

I get the following error when I try to compile:

19-Jun-2009 3:36:09 AM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed com.google.apphosting.utils.jetty.DevAppEngineWebAppContext@1c7d682{/,C:\Documents and Settings\Geoff Denning\workspace\TaskPath\war}
javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found

I've already added the gwt-gears.jar file to my \war\WEB-INF\lib directory, and I've referenced it in Eclipse as follows:

Java Build Path in Eclipse

I've even opened the gwt-gears.jar file and confirmed that org/apache/xerces/jaxp/SAXParserFactoryImpl.class does exist. Can anyone give me any pointers as to why I'm getting the above error?

Best Answer

Check that Xerces exists in:

$JAVA_HOME/lib/endorsed

Sounds like a Java 5 issue. Also check the Java system property for:

javax.xml.parsers.SAXParserFactory

It should be:

org.apache.xerces.jaxp.SAXParserFactoryImpl

If not then that's your issue, make sure you set the system property.

Related Topic