title: Getting “No unapply or unapplySeq function found” exception in Scala Play application
body: <p>I am trying a web application with Scala Play 2, Slick 3 and PostgreSQL. My purpose to return JSON from controller.</p>
  
  <p>These are the Dependencies -</p>
  
  <pre><code>libraryDependencies ++= Seq(
      "org.postgresql" % "postgresql" % "9.4-1201-jdbc41",
      "com.typesafe.slick" %% "slick" % "3.0.0",
      "com.typesafe.play" %% "play-slick" % "1.0.1",
      "com.typesafe.play" %% "play-slick-evolutions" % "1.0.1",
      specs2 % Test
  )
  </code></pre>
  
  <p>This is my Model - </p>
  
  <pre><code>package models
  
  import play.api.libs.json.Json
  import slick.driver.PostgresDriver.api._
  import scala.concurrent.Future
  
  case class User(id: String, name: String)
  
  object Users extends ModelInit {
      class UserModel(tag: Tag) extends Table[User](tag, "USERS") {
          def id = column[String]("ID", O.PrimaryKey)
          def email = column[String]("EMAIL")
          def * = (id, email) &lt;&gt; (User.tupled, User.unapply)
      }
  
      lazy val users = TableQuery[UserModel]
      implicit val userFormat = Json.format[UserModel]
  
      def all = {
          db.run(users.result)
      }
  
      def create(user: User): Future[Int] = {
          db.run(users += user)
      }
  
      def getById(name: String) = {
          val selectQuery = users.map(_.id)
          val selectAction = selectQuery.result
          db.run(selectAction)
     }
  }
  </code></pre>
  
  <p>This is my Controller -</p>
  
  <pre><code>package controllers
  
  import models.Users
  import play.api.mvc._
  import play.api.libs.concurrent.Execution.Implicits._
  import play.api.libs.json._
  
  class Application extends Controller {
      def index = Action {
          Users.all.map(user =&gt; println(Json.toJson(user)))
          Ok(views.html.index("Your new application is ready."))
      }
  }
  </code></pre>
  
  <p>Currently I am getting "No unapply or unapplySeq function found" exception. Here is the full stacktrace - </p>
  
  <pre><code>play.sbt.PlayExceptions$CompilationException: Compilation error[No unapply or unapplySeq function found]
          at play.sbt.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:27) ~[na:na]
          at play.sbt.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:27) ~[na:na]
          at scala.Option.map(Option.scala:145) ~[scala-library.jar:na]
          at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:49) ~[na:na]
          at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:44) ~[na:na]
          at scala.Option.map(Option.scala:145) ~[scala-library.jar:na]
          at play.sbt.run.PlayReload$.taskFailureHandler(PlayReload.scala:44) ~[na:na]
          at play.sbt.run.PlayReload$.compileFailure(PlayReload.scala:40) ~[na:na]
          at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17) ~[na:na]
          at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17) ~[na:na]
          at scala.util.Either$LeftProjection.map(Either.scala:377) ~[scala-library.jar:na]
          at play.sbt.run.PlayReload$.compile(PlayReload.scala:17) ~[na:na]
          at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3$$anonfun$2.apply(PlayRun.scala:61) ~[na:na]
          at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3$$anonfun$2.apply(PlayRun.scala:61) ~[na:na]
          at play.runsupport.Reloader$$anonfun$reload$1.apply(Reloader.scala:323) ~[na:na]
          at play.runsupport.Reloader$$anon$3.run(Reloader.scala:43) ~[na:na]
          at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_05]
          at play.runsupport.Reloader$.play$runsupport$Reloader$$withReloaderContextClassLoader(Reloader.scala:39) ~[na:na]
          at play.runsupport.Reloader.reload(Reloader.scala:321) ~[na:na]
          at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:113) ~[play-server_2.11-2.4.3.jar:2.4.3]
          at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:111) ~[play-server_2.11-2.4.3.jar:2.4.3]
          at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) ~[scala-library.jar:na]
          at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) ~[scala-library.jar:na]
          at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40) ~[akka-actor_2.11-2.3.13.jar:na]
          at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397) ~[akka-actor_2.11-2.3.13.jar:na]
          at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) ~[scala-library.jar:na]
          at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) ~[scala-library.jar:na]
          at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) ~[scala-library.jar:na]
          at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) ~[scala-library.jar:na]
  </code></pre>