Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

xerces

gwt

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?

like image 742
Templar Avatar asked Jun 19 '09 03:06

Templar


2 Answers

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.

like image 55
Jon Avatar answered Oct 18 '22 05:10

Jon


Apparently this is a bug in jre 1.5. I was able to resolve the problem by switching my default JRE in Eclipse from 1.5.0_06 to 1.6.0_03, as shown below:

Eclipse Installed JREs

Thanks to Jon and Rahul for pointing me in the right direction.

like image 37
Templar Avatar answered Oct 18 '22 05:10

Templar