title: No multipartconfig for servlet error from Jetty using scalatra
body: <p>I am trying to unit test an upload call but I get this error for the following code:</p>
  
  <pre><code>@MultipartConfig(maxFileSize = 3145728)
  class WebServlet extends ScalatraServlet with FileUploadSupport {
    override def isSizeConstraintException(e: Exception) = e match {
      case se: ServletException if se.getMessage.contains("exceeds max filesize") ||
        se.getMessage.startsWith("Request exceeds maxRequestSize") =&gt; true
      case _ =&gt; false
    }
    error {
      case e: SizeConstraintExceededException =&gt; RequestEntityTooLarge("too much!")
    }
    post("/uploadscript") {
      val privateParam = try {params("private") != null &amp;&amp; params("private").equals("true") } catch { case _ =&gt; false }
      println("privateParam = " + privateParam)
      val file = fileParams("file")
      println(s"The size of the file is ${file.size}")
    }
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>java.lang.IllegalStateException: No multipart config for servlet
      at org.eclipse.jetty.server.Request.getParts(Request.java:2064) ~[jetty-server-8.1.10.v20130312.jar:8.1.10.v20130312]
      at org.scalatra.servlet.FileUploadSupport$class.getParts(FileUploadSupport.scala:133) ~[scalatra_2.10-2.2.1.jar:2.2.1]
      at org.scalatra.servlet.FileUploadSupport$class.extractMultipartParams(FileUploadSupport.scala:108) ~[scalatra_2.10-2.2.1.jar:2.2.1]
      at org.scalatra.servlet.FileUploadSupport$class.handle(FileUploadSupport.scala:79) ~[scalatra_2.10-2.2.1.jar:2.2.1]
      at com.ui.WebServlet.handle(WebServlet.scala:32) ~[classes/:na]
  </code></pre>
  
  <p>And this is my unit test, and the first one succeeds, so it is finding my webservice:</p>
  
  <pre><code>class WebServletSpecification extends MutableScalatraSpec {
    addServlet(classOf[WebServlet], "/*")
  
    "GET /hello" should {
      "return status 200" in {
        get("/hello/testcomputer") {
          status must_== 200
        }
      }
    }
    "POST /uploadscript" should {
      "return status 200" in {
      val scriptfile = "testfile"
      val scriptname = "basescript"
        post("/uploadscript", Map("private" -&gt; "true"), Map("file" -&gt; new File(scriptfile))) {
          status must_== 200
        }
      }
    }
  }
  </code></pre>
  
  <p>I am running this inside of Eclipse and I am not certain what is going on.</p>
  
  <p>It works fine with using <code>HttpPost</code> and <code>MultipartEntity</code> so it seems to be a problem with Eclipse or how the scalatra specification framework works.</p>
  
  <p>Any idea what may be going wrong?</p>
  
  <p>I don't have a separate web.xml.</p>
  
  <p>I am only using jetty 8.1.10, as seen from what I use in build.sbt:</p>
  
  <blockquote>
    <p>"org.eclipse.jetty" % "jetty-webapp" % "8.1.10.v20130312" %
    "container"</p>
  </blockquote>
  
  <p>,</p>