Java 我们不能在GAE中使用集合或集合作为返回类型吗?

Java 我们不能在GAE中使用集合或集合作为返回类型吗?,java,google-app-engine,gwt,Java,Google App Engine,Gwt,在我的代码中,我使用了Set作为函数addamp()的返回类型 所以,我遇到了一个编译错误。错误是: Compiling module com.employeedepartmentgae.Employeedepartmentgae Refreshing module from source Validating newly compiled units Removing units with errors [ERROR] Errors

在我的代码中,我使用了
Set
作为函数
addamp()
的返回类型

所以,我遇到了一个编译错误。错误是:

Compiling module com.employeedepartmentgae.Employeedepartmentgae Refreshing module from source Validating newly compiled units Removing units with errors [ERROR] Errors in 'file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/GreetingServiceAsync.java' [ERROR] Line 6: The import com.employeedepartmentgae.server.domainobject.Employee cannot be resolved [ERROR] Line 18: Employee cannot be resolved to a type [ERROR] Errors in 'file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/GreetingService.java' [ERROR] Line 6: The import com.employeedepartmentgae.server.domainobject.Employee cannot be resolved [ERROR] Line 20: Employee cannot be resolved to a type [ERROR] Errors in 'file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/EmployeeWidget.java' [ERROR] Line 12: The import com.employeedepartmentgae.server.domainobject.Employee cannot be resolved [ERROR] Line 75: The method addEmp(String, String, String, AsyncCallback>) from the type GreetingServiceAsync refers to the missing type Employee [ERROR] Line 75: The type new AsyncCallback>(){} must implement the inherited abstract method AsyncCallback>.onSuccess(Set) [ERROR] Line 75: Employee cannot be resolved to a type [ERROR] Line 94: The method onSuccess(Set) of type new AsyncCallback>(){} must override or implement a supertype method [ERROR] Line 94: Employee cannot be resolved to a type [ERROR] Line 96: Employee cannot be resolved to a type [ERROR] Line 96: Employee cannot be resolved to a type [ERROR] Line 98: Employee cannot be resolved to a type Removing invalidated units [WARN] Compilation unit 'file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/Employeedepartmentgae.java' is removed due to invalid reference(s): [WARN] file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/EmployeeWidget.java [WARN] Compilation unit 'file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/DepartmentWidget.java' is removed due to invalid reference(s): [WARN] file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/GreetingService.java [WARN] file:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/GreetingServiceAsync.java Computing all possible rebind results for 'com.employeedepartmentgae.client.Employeedepartmentgae' Rebinding com.employeedepartmentgae.client.Employeedepartmentgae Checking rule [ERROR] Unable to find type 'com.employeedepartmentgae.client.Employeedepartmentgae' [ERROR] Hint: Previous compiler errors may have made this type unavailable [ERROR] 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 编译模块com.employeedepartmentgae.employeedepartmentgae 从源刷新模块 验证新编译的单元 删除有错误的单元 “文件:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/GreetingServiceAsync.java”中的[ERROR]错误 [错误]第6行:无法解析导入com.employeedepartmentgae.server.domainobject.Employee [错误]第18行:无法将员工解析为类型 “文件:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/GreetingService.java”中的[ERROR]错误 [错误]第6行:无法解析导入com.employeedepartmentgae.server.domainobject.Employee [错误]第20行:无法将员工解析为类型 “文件:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/EmployeeWidget.java”中的[ERROR]错误 [错误]第12行:无法解析导入com.employeedepartmentgae.server.domainobject.Employee [错误]第75行:GreetingServiceAsync类型中的方法addamp(String,String,String,AsyncCallback>)引用了缺少的Employee类型 [错误]第75行:类型new AsyncCallback>(){}必须实现继承的抽象方法AsyncCallback>.onSuccess(Set) [错误]第75行:无法将员工解析为类型 [错误]第94行:new AsyncCallback>(){}类型的onSuccess(Set)方法必须重写或实现超类型方法 [错误]第94行:无法将员工解析为类型 [错误]第96行:无法将员工解析为类型 [错误]第96行:无法将员工解析为类型 [错误]第98行:无法将员工解析为类型 删除失效单元 [警告]编译单元文件:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/employeedepartmentgae.java因引用无效而被删除: [警告]文件:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/EmployeeWidget.java [警告]编译单元文件:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/DepartmentWidget.java因引用无效而被删除: [警告]文件:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/GreetingService.java [警告]文件:/home/wissen18/employeedepartmentgae/src/com/employeedepartmentgae/client/GreetingServiceAsync.java 正在计算“com.employeedepartmentgae.client.employeedepartmentgae”的所有可能重新绑定结果 重新绑定com.employeedepartmentgae.client.employeedepartmentgae 检查规则 [错误]找不到类型'com.employeedepartmentgae.client.employeedepartmentgae' [错误]提示:以前的编译器错误可能导致此类型不可用 [错误]提示:检查模块中的继承链;它可能没有继承所需的模块,或者模块可能没有正确添加其源路径项
因此,请帮助我……

这不是GAE问题,但您没有提到您使用的GWT存在问题

从堆栈跟踪来看,Employee类似乎使用了未正确实现的AsyncCallback


[错误]第75行:类型new AsyncCallback>(){}必须实现继承的抽象方法AsyncCallback>.onSuccess(Set) ...


我建议您查看GWT文档并创建HelloWorld应用程序,它将在其中创建一个RPC示例。

您可以发布您的实体代码吗?还有您的数据访问代码?已解决-不是GAE问题,是GWT问题此问题是否仍处于活动状态???实际上,问题似乎出在
Employee
类上,而不是
AsyncCallback
的实现上,因为错误消息说“Employee无法解析为类型”--我们可以查看Employee类来了解问题所在吗?@Jason Hall他正在Employee类中调用AsyncCallback。他的部分实现很差,不允许员工编译。我相信你们,但可能还有其他问题。看到一些代码提示会很有帮助!提示!