Skip to content

Instantly share code, notes, and snippets.

@dwursteisen
Created May 30, 2011 10:17
Show Gist options
  • Save dwursteisen/998689 to your computer and use it in GitHub Desktop.
Save dwursteisen/998689 to your computer and use it in GitHub Desktop.
package controllers;
import play.mvc.Controller;
import java.util.ArrayList;
import java.util.List;
public class Application extends Controller {
public static class MyObject {
public String address;
}
public static void index() {
List<MyObject> myList = new ArrayList();
MyObject o1 = new MyObject();
MyObject o2 = new MyObject();
o1.address = "fdgdfgdf";
o2.address = "ljljlj";
myList.add(o1);
myList.add(o2);
otherAction(myList);
}
public static void otherAction(List<MyObject> objects) {
render("index.html");
}
}
Internal Server Error (500) for request GET /
Oops: ClassCastException
An unexpected error occured caused by exception ClassCastException: java.lang.String cannot be cast to java.util.List
play.exceptions.UnexpectedException: Unexpected Error
at play.mvc.Controller.redirect(Controller.java:610)
at play.mvc.Controller.redirect(Controller.java:540)
at controllers.Application.otherAction(Application.java)
at controllers.Application.index(Application.java:23)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:540)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:498)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:474)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:469)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:157)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
at play.data.binding.Unbinder.unBind(Unbinder.java:44)
at play.data.binding.Unbinder.unBind(Unbinder.java:110)
at play.data.binding.Unbinder.unBind(Unbinder.java:63)
at play.data.binding.Unbinder.unBind(Unbinder.java:29)
at play.mvc.Controller.redirect(Controller.java:575)
... 9 more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment