因此,我在Eclipse中有一个常规的Java项目IRBenchmarker,我在其中定义了几个类,其中一个是枚举edu.mit.ll.irbenchmark.EvaluationMetric。现在,我正在编写一个Google Web Toolkit Eclipse项目IRBenchmarker WebGUI,我希望客户端将一个EvaluationMetric值作为参数传递给服务器上的服务。
我遵循了Eclipse 3.4 GWT 1.6 project - how to reference source from other projects?上的说明,但一定是做错了什么。下面是我的设置。
workspace
-- IRBenchmarker-WebGUI
-- src
-- edu.mit.ll.irbenchmark
-- IRBenchmarker_WebGUI.gwt.xml
-- IRBenchmarker
-- src
-- edu.mit.ll.irbenchmark
-- IRBenchmarker.gwt.xml
-- edu.mit.ll.irbenchmark.client
-- EvaluationMetric.java文件IRBenchmarker.gwt.xml包含:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<!-- Expose classes useful to the web client as a Google Web Toolkit module -->
<module rename-to='IRBenchmarker'>
<inherits name='com.google.gwt.user.User' />
<source path="client" />
</module>文件IRBenchmarker_WebGUI.gwt.xml包含:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='irbenchmarker_webgui'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<inherits name="edu.mit.ll.irbenchmark.IRBenchmarker" />
<!-- Specify the app entry point class. -->
<entry-point class='edu.mit.ll.irbenchmark.client.IRBenchmarker_WebGUI'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
</module>IRBenchmarker WebGUI的Eclipse Java构建路径包含项目IRBenchmarker。
当我尝试运行项目并在浏览器中打开页面时,我得到
[ERROR] [irbenchmarker_webgui] - Line 124: No source code is available for type edu.mit.ll.irbenchmark.client.EvaluationMetric; did you forget to inherit a required module?请注意,在此错误之上,在“验证新编译的单元”下有
10:57:15.767 [INFO] [irbenchmarker_webgui] Ignored 3 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.我遗漏了什么?
更新:因此,我将使用来自IRBenchmarker的源代码创建一个JAR文件,并将其包含在IRBenchmarker中。似乎可以工作,尽管每次在IRBenchmarker中更改代码时都必须重新构建jar是不方便的。
发布于 2012-10-27 02:34:06
您可能需要在DevMode启动配置的Classpath选项卡中显式添加另一个项目的src文件夹。
发布于 2012-10-27 02:05:39
试着把
<inherits name="edu.mit.ll.irbenchmark.IRBenchmarker" />在你的IRBenchmarker.gwt.xml中也是如此
我在GWT中有一个单独的项目来保存我的模型,我在两个GWT.xml文件中都有这一行。
此外,确保与项目的文件夹结构相匹配的根客户端和服务器包与GWT项目中的完全相同的结构相匹配。
https://stackoverflow.com/questions/13089586
复制相似问题