8

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?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Templar
  • 5,067
  • 7
  • 34
  • 39
  • 1
    what version of java are you using? Have you recently changed the version from 1.4 to 1.5 ? – Rahul Jun 19 '09 at 04:18

6 Answers6

5

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.

Jonathan Holloway
  • 62,090
  • 32
  • 125
  • 150
2

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.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Templar
  • 5,067
  • 7
  • 34
  • 39
1

This happened to me. I had conflicting JARs in my workspace. I removed one and boom it worked. The message didn't lend very well to the root of the error.

Roland
  • 11
  • 1
  • In my case, after days fighting with the exact same problem, I found I had a `SAXParserFactoryImpl` class in a `xercesImpl-2.8.1.jar` in one of my uses library. I just had to copy this jar into the WEB-INF/lib and add it to the .settings\com.google.appengine.eclipse.core.prefs Works like a charm now. – eskalera Oct 25 '12 at 11:21
1

My SAXParserFactoryImpl problem was caused by gwt-gadgets.jar I had in my boot class path. Removing this JAR from the boot class path solved the problem for me. Basically you have to remove any JAR containing a SAXParserFactoryImpl class from your build path (user libs).

Alex
  • 8,245
  • 8
  • 46
  • 55
0

Take a look at Trouble with Selenium (XercesImpl) and Google App Engine. I had a similar problem with GWT / 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
Community
  • 1
  • 1
0

Remove the $JAVA_HOME/jre/lib/jaxp.properties fixed the issue.

Isaiah
  • 329
  • 4
  • 7