title: How to include file in production mode for Play framework
body: <p>An overview of my environments:
  Mac OS Yosemite, Play framework 2.3.7, sbt 0.13.7, Intellij Idea 14, java 1.8.0_25</p>
  
  <p>I tried to run a simple Spark program in Play framework, so I just create a Play 2 project in Intellij, and change some files as follows:</p>
  
  <p>app/Controllers/Application.scala:</p>
  
  <pre><code>package controllers
  
  import play.api._
  import play.api.libs.iteratee.Enumerator
  import play.api.mvc._
  
  object Application extends Controller {
  
    def index = Action {
      Ok(views.html.index("Your new application is ready."))
    }
  
    def trySpark = Action {
      Ok.chunked(Enumerator(utils.TrySpark.runSpark))
    }
  
  }
  </code></pre>
  
  <p>app/utils/TrySpark.scala:</p>
  
  <pre><code>package utils
  
  import org.apache.spark.{SparkContext, SparkConf}
  
  object TrySpark {
    def runSpark: String = {
      val conf = new SparkConf().setAppName("trySpark").setMaster("local[4]")
      val sc = new SparkContext(conf)
      val data = sc.textFile("public/data/array.txt")
      val array = data.map ( line =&gt; line.split(' ').map(_.toDouble) )
      val sum = array.first().reduce( (a, b) =&gt; a + b )
      return sum.toString
    }
  }
  </code></pre>
  
  <p>public/data/array.txt:</p>
  
  <pre><code>1 2 3 4 5 6 7
  </code></pre>
  
  <p>conf/routes:</p>
  
  <pre><code>GET        /                    controllers.Application.index
  
  GET        /spark               controllers.Application.trySpark
  
  GET        /assets/*file        controllers.Assets.at(path="/public", file)
  </code></pre>
  
  <p>build.sbt:</p>
  
  <pre><code>name := "trySpark"
  
  version := "1.0"
  
  lazy val `tryspark` = (project in file(".")).enablePlugins(PlayScala)
  
  scalaVersion := "2.10.4"
  
  libraryDependencies ++= Seq( jdbc , anorm , cache , ws,
  "org.apache.spark" % "spark-core_2.10" % "1.2.0")
  
  unmanagedResourceDirectories in Test &lt;+=  baseDirectory ( _ /"target/web/public/test" )  
  </code></pre>
  
  <p>I type <code>activator run</code> to run this app in development mode then type <code>localhost:9000/spark</code> in the browser, it shows result <code>28</code> as expected. However, when I want type <code>activator start</code> to run this app in production mode it shows the following error message:</p>
  
  <pre><code>[info] play - Application started (Prod)
  [info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
  [error] application - 
  
  ! @6kik15fee - Internal server error, for (GET) [/spark] -&gt;
  
  play.api.Application$$anon$1: Execution exception[[InvalidInputException: Input path does not exist: file:/Path/to/my/project/target/universal/stage/public/data/array.txt]]
      at play.api.Application$class.handleError(Application.scala:296) ~[com.typesafe.play.play_2.10-2.3.7.jar:2.3.7]
      at play.api.DefaultApplication.handleError(Application.scala:402) [com.typesafe.play.play_2.10-2.3.7.jar:2.3.7]
      at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$14$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:205) [com.typesafe.play.play_2.10-2.3.7.jar:2.3.7]
      at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$14$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:202) [com.typesafe.play.play_2.10-2.3.7.jar:2.3.7]
      at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33) [org.scala-lang.scala-library-2.10.4.jar:na]
  Caused by: org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file:/Path/to/my/project/target/universal/stage/public/data/array.txt
      at org.apache.hadoop.mapred.FileInputFormat.listStatus(FileInputFormat.java:251) ~[org.apache.hadoop.hadoop-mapreduce-client-core-2.2.0.jar:na]
      at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:270) ~[org.apache.hadoop.hadoop-mapreduce-client-core-2.2.0.jar:na]
      at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:201) ~[org.apache.spark.spark-core_2.10-1.2.0.jar:1.2.0]
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:205) ~[org.apache.spark.spark-core_2.10-1.2.0.jar:1.2.0]
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:203) ~[org.apache.spark.spark-core_2.10-1.2.0.jar:1.2.0]
  </code></pre>
  
  <p>It seems that my <code>array.txt</code> file is not loaded in the production mode. How can solve this problem?</p>