在 GWT 中导入 Gears API 时找不到 org.apache.xerces.jaxp.SAXParserFactoryImpl

发布于 2024-07-24 14:47:10 字数 1248 浏览 7 评论 0原文

我使用 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 中引用它,如下所示:

Eclipse 中的 Java 构建路径

我什至打开了 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:

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

分开我的手 2024-07-31 14:47:10

检查 Xerces 是否存在于:

$JAVA_HOME/lib/endorsed

听起来像是 Java 5 问题。 另请检查 Java 系统属性:

javax.xml.parsers.SAXParserFactory

应该是:

org.apache.xerces.jaxp.SAXParserFactoryImpl

如果不是,那就是您的问题,请确保设置系统属性。

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.

旧夏天 2024-07-31 14:47:10

显然这是 jre 1.5 中的一个错误。 我可以通过将 Eclipse 中的默认 JRE 从 1.5.0_06 切换到 1.6.0_03 来解决该问题,如下所示:

Eclipse 安装的 JRE

感谢乔恩拉胡尔< /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:

Eclipse Installed JREs

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

古镇旧梦 2024-07-31 14:47:10

这发生在我身上。 我的工作区中存在冲突的 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.

梦毁影碎の 2024-07-31 14:47:10

我的 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).

鸵鸟症 2024-07-31 14:47:10

删除 $JAVA_HOME/jre/lib/jaxp.properties 修复了该问题。

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

终弃我 2024-07-31 14:47:10

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文