2012-03-16 45 views
0

的Grails我要帶給用戶的會話,但使我空,如果有一個人的時候在會議MissingMethodException與springSecurity

 groovy.lang.MissingMethodException: No signature of method: 
     general.Evento.findByAllAsistentes() is applicable for argument types:(general.Usuario) values: [null] 

現在有了.currentUser嘗試它,並且還與.principal但我並不覺得......

//def user = springSecurityService.currentUser 
    def user = Usuario.get(springSecurityService.principal.id) 
    log.debug "User: ${user}" // Not found, it prints null 

    Evento event = Evento.get(params.id) 

    if(!event.findByAllAsistentes(user)){ 
       log.debug "Asistent to Event" 
      } 

我需要你的幫助,請

回答

3

findByAllAsistentes也許應該findAllByAsistentes,除非你的事件摘要域對象有一個屬性稱爲allAsistentes

+0

感謝您的回覆如此之快...我沒有意識到我有這個錯誤,我糾正了,但仍然繼續讓我上面的錯誤,另一個建議嗎? – 2012-03-20 15:19:23

+0

很難說沒有看到你的'Evento'域類。你可以發佈嗎? – ataylor 2012-03-20 18:56:00