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

6

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?

Densimeter answered 19/6, 2009 at 3:56 Comment(1)
what version of java are you using? Have you recently changed the version from 1.4 to 1.5 ?Unfledged
D
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.

Densimeter answered 20/6, 2009 at 2:24 Comment(0)
N
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.

Natheless answered 19/6, 2009 at 4:36 Comment(1)
In practice, how to do that?Ignorant
D
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.

Densimeter answered 20/6, 2009 at 2:24 Comment(0)
M
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.

Meade answered 23/6, 2010 at 0:13 Comment(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.Lodge
M
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).

Mauldin answered 12/8, 2010 at 4:52 Comment(0)
M
0

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

Mechanotherapy answered 9/12, 2010 at 8:39 Comment(0)
F
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
Filibeg answered 19/2, 2013 at 18:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.