2010-02-17 3 views
0

Dans mon code j'ai utilisé Set<Employees> comme un type de retour à ma fonction addEmp().Nous ne pouvons pas utiliser un ensemble ou une collection comme type de retour dans GAE?

Donc, je mets une erreur de compilation. L'erreur est:

 
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 

Alors s'il vous plaît aidez-moi .....

+0

Pourriez-vous publier votre code d'entité? Egalement votre code d'accès? –

+0

Résolu - Pas problème GAE, c'est problème GWT –

+0

user273422 êtes-vous là? –

Répondre

1

Ce n'est pas un problème GAE, mais vous ne mentionnez pas que vous utilisez GWT qui a un problème. A partir de la trace de la pile, il semble que la classe Employee utilise AsyncCallback qui n'est pas implémentée correctement.

...
[ERREUR] Ligne 75: Le nouveau type AsyncCallback>() {} doit mettre en œuvre la méthode abstraite héritée AsyncCallback> .onSuccess (Set) ...

Ma recommandation est de vous pour regarder les documents GWT et aussi créer l'application HelloWorld et il va créer un exemple de RPC dans celui-ci.

+0

En fait, il semble que le problème est avec la classe 'Employee', pas l'implémentation de' AsyncCallback' car les messages d'erreur disent "L'employé ne peut pas être résolu en un type" - peut-on voir la classe Employee pour savoir quel est le problème? ? –

+0

@Jason Hall Il appelle AsyncCallback dans sa classe Employé. Il est mal implémenté de sa part et ne permettra pas à l'employé de compiler. –

+0

Je vous crois, mais il peut y avoir d'autres problèmes aussi. Il serait très utile de voir du code * indice! indice! * –

Questions connexes