【发布时间】:2012-07-12 02:47:09
【问题描述】:
我在 GWT 编译期间遇到此编译错误。我正在使用它来解析 XML 文档。
[ERROR] Line 24: No source code is available for type org.w3c.dom.Node; did you forget to inherit a required module?
[ERROR] Line 28: No source code is available for type org.w3c.dom.NodeList; did you forget to inherit a required module?
[ERROR] Aborting compile due to errors in some input files
根据我对此进行的任何研究,它表明类路径可能丢失,但由于默认情况下这将包含在 gwt-user.jar 和 JRE7 中,而且我也没有包含任何外部 jar,所以没有重复的情况!而且您不能在客户端代码中包含这些类型的代码,因为它将被转换为 javascript
我有一个类在我的共享文件夹(GWT Model View Presenter Project structure)中使用这个节点,它基本上是一个模型!
- 将代码移动到服务器端是唯一可能的解决方案吗?
如果 1 为真,我将如何重构访问此模型的客户端演示者,而无需每次都进行 RPC 调用的开销?
是否有任何替代方法?
我的 GWT 配置文件。
<module rename-to='xxxxx'>
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
<inherits name="com.google.gwt.xml.XML" />
<entry-point class='com.xxxx.xxxxx.gwt.client.ProjectEntry'/>
<source path='client'/>
<source path='shared'/>
</module>
编辑:我现在已经包含了 xml 继承!它的工作原理
【问题讨论】:
-
你能发布你的 GWT 模块配置文件吗?