问题
I have a controller which hands a java-list of model-objects to the view exactly the way like it's done in the examples.
The compiler throws an error that it can't convert from java.util.List
to scala.collection.immutable.List
. I have no clue what I should do.
[error] /myapp/myappsubprojects/frontend/app/controllers/frontend/MyController.java:15: error: method render in class linklist cannot be applied to given types;
[error] return ok(linklist.render("link test", Link.findAll()));
[error] ^
[error] required: String,scala.collection.immutable.List<Link>
[error] found: String,java.util.List<Link>
[error] reason: actual argument java.util.List<Link> cannot be converted to scala.collection.immutable.List<Link> by method invocation conversion
[error] 1 error
Note: I'm using subprojects (common, frontend, backend) and I had a hard time to make everything run properly. Probably it's related to that.
回答1:
I went fishing for details and ended up (luckily) answering the question in my comment
来源:https://stackoverflow.com/questions/16116264/play-doesnt-convert-java-list-to-scala-list