title: Play Framework 2.1 upgrade, now having to cast everything for views?
body: <p>I just migrated across to Play Framework 2.1-RC1 from 2.0 on an existing project and for some reason I'm now having to cast everything to Scala classes from Java classes when I render the views. (Obviously I'm using Play in a Java project rather than a Scala project)</p>
  
  <p>Below is an example error...</p>
  
  <pre><code>render(java.lang.String,scala.collection.immutable.List&lt;models.User&gt;) in views.html.list cannot be applied to (java.lang.String,java.util.List&lt;models.User&gt;)
  </code></pre>
  
  <p>And the top line of my view...</p>
  
  <pre><code>@(message: String, users : List[models.User])
  </code></pre>
  
  <p>From this I surmise that for some reason classes aren't being automatically cast from <code>java.util.List</code> to the scala equivalent. I'm a Java guy, not a Scala guy at this stage so I may be doing something stupid.</p>
  
  <p>Example code that calls render...</p>
  
  <pre><code>public static Result list() {
          List&lt;User&gt; users = MorphiaManager.getDatastore().find(User.class).asList();
      System.out.println("about to try to display list of " + users.size() + " users");
          return ok(list.render("Welcome", msgs));
      }
  </code></pre>
  
  <p>Build.scala below</p>
  
  <pre><code>import sbt._
  import Keys._
  import PlayProject._
  
  object ApplicationBuild extends Build {
  
      val appName         = "blah-worker"
      val appVersion      = "1.0-SNAPSHOT"
  
      val appDependencies = Seq(
    // Play framework dependencies
    javaCore, javaJdbc, javaEbean,
    // Add your project dependencies here,
    "org.apache.camel" % "camel-core" % "2.10.0",
    "org.apache.camel" % "camel-jms" % "2.10.0",
    "org.apache.camel" % "camel-mail" % "2.10.0",
    "org.apache.camel" % "camel-jackson" % "2.10.0",
    "org.apache.camel" % "camel-gson" % "2.10.0",
    "org.apache.activemq" % "activemq-core" % "5.6.0",
    "org.apache.activemq" % "activemq-camel" % "5.6.0",
    "org.apache.activemq" % "activemq-pool" % "5.6.0",
    "com.google.code.morphia" % "morphia" % "0.99.1-SNAPSHOT",
    "com.google.code.morphia" % "morphia-logging-slf4j" % "0.99",
    "cglib" % "cglib-nodep" % "[2.1_3,)",
    "com.thoughtworks.proxytoys" % "proxytoys" % "1.0",
    "org.apache.james" % "apache-mime4j" % "0.7.2",
    ("org.jclouds" % "jclouds-allblobstore" % "1.5.0-beta.4").exclude("com.google.guava", "guava").exclude("org.reflections", "reflections"),
    ("org.reflections"                  %    "reflections"              %   "0.9.7").exclude("com.google.guava", "guava").exclude("javassist", "javassist")
  )
  
  val main = play.Project(appName, appVersion, appDependencies).settings(
    // Add your own project settings here
    resolvers += "Morphia repo" at "http://morphia.googlecode.com/svn/mavenrepo/",
    resolvers += "CodeHaus for ProxyToys" at "http://repository.codehaus.org/",
    checksums := Nil
  )
  
  }
  </code></pre>