在GWT中导入Gears API时未找到org.apache.xerces.jaxp.SAXParserFactoryImpl [英] org.apache.xerces.jaxp.SAXParserFactoryImpl not found when importing Gears API in GWT
问题描述
我使用Eclipse创建了一个 GWT 项目,该项目运行良好(我能够在托管模式和Google App Engine上运行它),直到我尝试导入 Google Web Toolkit的Gears API 。将以下代码行添加到我的java源文件中后:
import com.google.gwt.gears.client.geolocation.Geolocation;
当我尝试编译时,出现以下错误:
2009年6月19日上午3:36:09 com.google.apphosting.utils.jetty.JettyLogger警告
警告: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未找到
我已经将gwt-gears.jar文件添加到我的\ war \WEB-INF\lib目录,我在Eclipse中引用它如下:
Eclipse中的Java Build Path http://i41.tinypic.com/148klk4.png
I甚至打开了gwt-gears.jar文件,并确认org / apache / xerces / jaxp / SAXParserFactoryImpl.class确实存在。任何人都可以给我任何指针,为什么我得到上述错误?
显然这是一个错误在jre 1.5 。我可以通过在Eclipse中将我的默认JRE从1.5.0_06切换到1.6.0_03来解决问题,如下所示:
Eclipse安装的JRE http://i40.tinypic.com/15fktvd.png
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 http://i41.tinypic.com/148klk4.png
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?
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 http://i40.tinypic.com/15fktvd.png
Thanks to Jon and Rahul for pointing me in the right direction.
这篇关于在GWT中导入Gears API时未找到org.apache.xerces.jaxp.SAXParserFactoryImpl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!