我试着运行一本书中的示例代码,它给出了如下错误:
[DEBUG] [rpc] - Validating newly compiled units
[ERROR] [rpc] - Errors in 'file:/D:/UserData/ge000001/workspace/RPC/src/rpc/client/HelloService.java'
[ERROR] [rpc] - Line 8: No source code is available for type rpc.server.Person; did you forget to inherit a required module?
[ERROR] [rpc] - Errors in 'file:/D:/UserData/ge000001/workspace/RPC/src/rpc/client/HelloServiceAsync.java'
[ERROR] [rpc] - Line 9: No source code is available for type rpc.server.Person; did you forget to inherit a required module?
[ERROR] [rpc] - Errors in 'file:/D:/UserData/ge000001/workspace/RPC/src/rpc/client/RPC.java'
[ERROR] [rpc] - Line 106: No source code is available for type rpc.server.Person; did you forget to inherit a required module?
[TRACE] [rpc] - Finding entry point classes
[ERROR] [rpc] - Unable to find type 'rpc.client.RPC'
[ERROR] [rpc] - Hint: Previous compiler errors may have made this type unavailable
[ERROR] [rpc] - Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[ERROR] [rpc] - Failed to load module 'rpc' from user agent 'Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1' at localhost:1802这些类型错误在不同的项目中发生了很多次,我找不到原因?
你有什么想法或建议吗?
发布于 2011-08-04 15:27:35
这意味着由于某种原因,GWT找不到要包含在代码中的类。
当配置出现根本错误时,这些错误通常会发生,并且可能会非常令人困惑;通常是一些小而愚蠢的事情,会破坏一切。
正如错误消息所暗示的那样,这可能是因为使用<inherits name="com.yourcompany.project.SomeClass"/>没有包含它,或者是因为java找不到它(它在不同的路径中,而不在类路径或类似的路径中)。
也可能是这些类包含其他类/包,这些类/包无法转换为GWT代码,并被GWT忽略(不在核心java包中)。(另外,如果您使用eclipse:它有一个恼人的习惯,即自动为您输入错误的内容添加java import语句,请查看problems选项卡,查看是否有未使用的导入。您可能需要更改首选项;如果默认情况下未启用,请将“未使用的导入”设置为“警告”。)
尝试注释掉一些包含并重新编译,它可能会缩小问题所在的范围。使用像Eclipse这样的IDE,看看它是否报告错误。(关于当前的数据,我不能给你更多具体的帮助)
https://stackoverflow.com/questions/6937444
复制相似问题