在 GWT 中导入 Gears API 时找不到 org.apache.xerces.jaxp.SAXParserFactoryImpl
我使用 Eclipse 创建了一个 GWT 项目,该项目运行良好(我能够运行它在托管模式和 Google App Engine 上),直到我尝试导入 Google Web Toolkit 的 Gears API。 将以下行添加到我的 java 源文件后:
import com.google.gwt.gears.client.geolocation.Geolocation;
当我尝试编译时,出现以下错误:
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
我已经将 gwt-gears.jar 文件添加到我的 \war\WEB-INF\lib 目录中,并且我已经在 Eclipse 中引用它,如下所示:
我什至打开了 gwt-gears.jar 文件并确认 org/apache/xerces/jaxp/SAXParserFactoryImpl.class 确实存在。 谁能给我任何关于为什么我收到上述错误的指示?
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:
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
检查 Xerces 是否存在于:
听起来像是 Java 5 问题。 另请检查 Java 系统属性:
应该是:
如果不是,那就是您的问题,请确保设置系统属性。
Check that Xerces exists in:
Sounds like a Java 5 issue. Also check the Java system property for:
It should be:
If not then that's your issue, make sure you set the system property.
显然这是 jre 1.5 中的一个错误。 我可以通过将 Eclipse 中的默认 JRE 从 1.5.0_06 切换到 1.6.0_03 来解决该问题,如下所示:
感谢乔恩和拉胡尔< /a> 为我指明了正确的方向。
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:
Thanks to Jon and Rahul for pointing me in the right direction.
这发生在我身上。 我的工作区中存在冲突的 JAR。 我拆下了一个,然后就成功了。 该消息并不能很好地揭示错误的根源。
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.
我的 SAXParserFactoryImpl 问题是由引导类路径中的 gwt-gadgets.jar 引起的。 从引导类路径中删除这个 JAR 解决了我的问题。 基本上,您必须从构建路径(用户库)中删除包含 SAXParserFactoryImpl 类的任何 JAR。
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).
删除 $JAVA_HOME/jre/lib/jaxp.properties 修复了该问题。
Remove the $JAVA_HOME/jre/lib/jaxp.properties fixed the issue.
查看Selenium (XercesImpl) 和 Google App Engine 的问题。
我在 GWT / GAE 中遇到了类似的问题(未找到 SAXParserFactoyImpl)并通过以下方式解决了它:
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;