Guest User

Untitled

a guest
Jun 17th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 1.82 KB | None | 0 0
  1. Error Details
  2. Error 500: Executing action [random] of controller [qotd.QuoteController] caused exception: groovy.lang.MissingMethodException: No signature of method: static qotd.Quote.list() is applicable for argument types: () values: [] Possible solutions: is(java.lang.Object), wait(), wait(long), print(java.lang.Object), with(groovy.lang.Closure), print(java.io.PrintWriter)
  3. Servlet: grails
  4. URI: /qotd/grails/quote/random.dispatch
  5. Exception Message: No signature of method: static qotd.Quote.list() is applicable for argument types: () values: [] Possible solutions: is(java.lang.Object), wait(), wait(long), print(java.lang.Object), with(groovy.lang.Closure), print(java.io.PrintWriter)
  6. Caused by: No signature of method: static qotd.Quote.list() is applicable for argument types: () values: [] Possible solutions: is(java.lang.Object), wait(), wait(long), print(java.lang.Object), with(groovy.lang.Closure), print(java.io.PrintWriter)
  7. Class: QuoteController
  8. At Line: [8]
  9. Code Snippet:
  10. Stack Trace
  11. groovy.lang.MissingMethodException: No signature of method: static qotd.Quote.list() is applicable for argument types: () values: []
  12. Possible solutions: is(java.lang.Object), wait(), wait(long), print(java.lang.Object), with(groovy.lang.Closure), print(java.io.PrintWriter)
  13.  
  14.     at qotd.QuoteController$_closure3.doCall(QuoteController.groovy:8)
  15.  
  16.     at qotd.QuoteController$_closure3.doCall(QuoteController.groovy)
  17.  
  18.     at java.lang.Thread.run(Thread.java:722)
  19.  
  20.  
  21. /******************************/
  22.  
  23. package qotd
  24.  
  25. class QuoteController {
  26.  
  27.     def index = { redirect(action: home) }
  28.     def home = { render("test " + qotd.Quote.class) }
  29.     def random = {
  30.         def allQuotes = Quote.list()
  31.         if (allQuotes.size() > 0)
  32.         {
  33.             def randomId = new Random().next(allQuotes.size())
  34.             randomQuote = allQuotes[randomId]
  35.         }
  36.         [ quote : randomQuote]
  37.     }
  38. }
Add Comment
Please, Sign In to add comment