Giter Site home page Giter Site logo

scalatra / scalatra Goto Github PK

View Code? Open in Web Editor NEW
2.6K 80.0 334.0 7.8 MB

Tiny Scala high-performance, async web framework, inspired by Sinatra

Home Page: http://scalatra.org

License: Other

Scala 99.52% Java 0.48%
scala sinatra web-framework json jetty atmosphere scalate swagger

scalatra's Introduction

Scalatra Scala CI

Join the chat at https://gitter.im/scalatra/scalatra scalatra Scala version support

Scalatra is a tiny, Sinatra-like web framework for Scala.

Example

import org.scalatra._

class ScalatraExample extends ScalatraServlet {
  get("/") {
    <h1>Hello, world!</h1>
  }
}

Documentation

If you're just starting out, see the installation and first project sections of our website.

Once you've done that, take a look at the Scalatra Guides for documentation on all aspects of the framework, code examples, and more. We also have an extensive selection of Example Applications which accompany the tutorials in the Scalatra Guides.

Latest version

The latest version of Scalatra is 3.0.+, and is published to Maven Central.

// for javax
libraryDependencies += "org.scalatra" %% "scalatra-javax" % "3.0.+"

// for jakarta
libraryDependencies += "org.scalatra" %% "scalatra-jakarta" % "3.0.+"

Community

scalatra's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scalatra's Issues

Full support for all HTTP methods

http://twitter.com/#!/raulbajales/status/55993715692552194

  • OPTIONS: Supported, but could have better default behavior. Specifically, should look for matching routes of other methods, and return header with all supported methods on request for "*".
  • HEAD: Forwarded to GET, and body discarded by servlet. Do we have any reason to override?
  • GET: Supported.
  • POST: Supported.
  • PUT: Supported.
  • DELETE: Supported.
  • TRACE: Inherited from servlet spec. Do we have any reason to override?
  • CONNECT: Not supported. We should probably add it, though I'm unsure how it would be used in Scalatra.
  • Extension methods: Not supported. We could allow them, though they wouldn't have explicit methods in the DSL.

specs2: can't use test framework blocks as example fragments

A spec like this ...

class EnvironmentFilterSpec extends ScalatraSpec {
  "The dev filter should"                                  ^
    "return 'development' as the environment"              ! env("dev", "development")^
  // snip
  def env(environment: String, expected: String) =
    get("/%s/environment".format(environment)) {
      body must be equalTo(expected)
    }
}

makes the compiler say could not find implicit value for evidence parameter of type (Unit) => org.specs2.execute.Result

get, post, and friends should return their result instead of Unit, I think.

ScalaTest test cases with Scalatra, mixing in WordSpec, FlatSpec, etc...

http://groups.google.com/group/scalatra-user/browse_thread/thread/aeb8146135081413

I tried mixing in the WordSpec xor FlatSpec into test cases I wanted
to write, and it barfed on me with some errors, about how run was
defined in both traits (whichever one I mixed in and
BeforeAndAfterAll). Some googling turned up that BeforeAndAfterAll or
BeforeAndAfterEach needs to be mixed in LAST.

With the current implementation of ScalatraSuite this isn't workable.
The obvious and kinda sucky work around is to create ScalatraSuite
traits which inherit from each of the appropriate trait such that
there is appropriate functionality as desired.

FlashMap swept too early with nested filters.

When two ScalatraFilters with FlashMapSupport are in the chain, the inner filter sweeps the flash map before the outer filter completes.

  • Sweep should only be called by the FlashMapSupport instance that created the flash map.
  • Automatic sweeping could be disabled. See paulitex's gist. This is the default behavior of Rack Flash. This puts the burden on the developer to access all attributes, but would play nicer with multiple redirects. Consider making this a configurable option like Rack Flash.

Chat demo throws exception and only displays "Connecting.." in master

When opening the chat demo it gets stuck saying "Connecting...". Following exception is printed on the console.

Jetty-websocket's WebSocketFactory doesn't have an empty argument constructor in version 7.4.1.v20110513, which is defined in the project file.

Using version 7.1.6.v20100715 seems to be getting running further as it fails with NullPointerException in the SocketIOSupport handle method.

I'm using sbt jetty-run task to run the project. I noticed that the documentation says that it's not working from sbt, but it would be so much more convenient to be able to run it from there.

java.lang.NoSuchMethodError: org.eclipse.jetty.websocket.WebSocketFactory: method <init>()V not found
    at com.glines.socketio.server.transport.WebSocketTransport.<init>(WebSocketTransport.java:211)
    at org.scalatra.socketio.SocketIOSupport$class.initialize(SocketIOSupport.scala:138)
    at org.scalatra.ChatServlet.initialize(ChatServlet.scala:6)
    at org.scalatra.ScalatraServlet.init(ScalatraServlet.scala:43)
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:436)
    at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:331)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:515)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1352)
    at org.scalatra.ScalatraFilter$$anonfun$1.apply$mcV$sp(ScalatraFilter.scala:26)
    at org.scalatra.ScalatraFilter$$anonfun$1.apply(ScalatraFilter.scala:26)
    at org.scalatra.ScalatraFilter$$anonfun$1.apply(ScalatraFilter.scala:26)
    at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2$$anonfun$8.apply(ScalatraKernel.scala:137)
    at scala.Option.getOrElse(Option.scala:109)
    at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply$mcV$sp(ScalatraKernel.scala:137)
    at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:134)
    at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:134)
    at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
    at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(ScalatraKernel.scala:134)
    at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(ScalatraKernel.scala:134)
    at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(ScalatraKernel.scala:134)
    at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
    at org.scalatra.ScalatraKernel$$anonfun$handle$1.apply$mcV$sp(ScalatraKernel.scala:133)
    at org.scalatra.ScalatraKernel$$anonfun$handle$1.apply(ScalatraKernel.scala:133)
    at org.scalatra.ScalatraKernel$$anonfun$handle$1.apply(ScalatraKernel.scala:133)
    at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
    at org.scalatra.ScalatraKernel$class.handle(ScalatraKernel.scala:132)
    at org.scalatra.FilterExample.handle(FilterExample.scala:3)
    at org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply$mcV$sp(ScalatraFilter.scala:18)
    at org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply(ScalatraFilter.scala:18)
    at org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply(ScalatraFilter.scala:18)
    at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
    at org.scalatra.ScalatraFilter$class.doFilter(ScalatraFilter.scala:17)
    at org.scalatra.FilterExample.doFilter(FilterExample.scala:3)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1323)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:476)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:937)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:871)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
    at org.eclipse.jetty.server.Server.handle(Server.java:346)
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:589)
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1048)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:601)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)
    at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:535)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
    at java.lang.Thread.run(Thread.java:662)

a35daca8 Breaks scalatra-sbt-prototype (At this exact moment)

Sorry if scalatra-sbt-prototype is a better home for this.

Commit a35daca added a dependency on Scalate that isn't yet published in any repos specified in the scalatra-sbt-prototype project.

$ git clone http://github.com/scalatra/scalatra-sbt-prototype.git
$ cd scalatra-sbt-prototype
$ sbt update
...snip...
[warn]          ::::::::::::::::::::::::::::::::::::::::::::::
[warn]          ::          UNRESOLVED DEPENDENCIES         ::
[warn]          ::::::::::::::::::::::::::::::::::::::::::::::
[warn]          :: org.fusesource.scalate#scalate-core;1.3-SNAPSHOT: not found
[warn]          ::::::::::::::::::::::::::::::::::::::::::::::

Flash doesn't load value on the next request but on the request after

My scenario is this:

  1. I submit a form using post
  2. I set the flash message and redirect from the post action to another url
  3. The flash is EMPTY on this request and the message doesn't show on the page
  4. I load another page and the message appears
  5. On the next request it is gone again

The get action that follows the original post action is located in another ScalatraServlet.

I'm using scalatra version 2.0.0-SNAPSHOT with scala version 2.9.0-1.

I don't use flash.keep anywhere. What could be the problem?

When running the "publish-local" action from sbt, created ivy.xml references a non-existant .war

This causes other SBT projects that have step as a dependency in their project build to error trying to retrieve that WAR when running the "update" action.
What I've been doing is delete the <artifact type="war" .../> line in the ivy.xml. There's a line right next to it referencing the .jar, and that works just fine.

Relevant SBT output after running "publish-local":

[info] Packaging ./target/scala_2.7.7/step_2.7.7-1.1.6-SNAPSHOT.jar ...
[info] Packaging complete.
[info] == package ==
[info] 
[info] == deliver-local ==
[info] :: delivering :: com.thinkminimo.step#step_2.7.7;1.1.6-SNAPSHOT :: 1.1.6-SNAPSHOT :: release :: Tue Mar 30 21:41:37 UTC 2010 
[info]  delivering ivy file to $HOME/step/target/scala_2.7.7/ivy-1.1.6-SNAPSHOT.xml
[info] == deliver-local ==
[info] 
[info] == publish-local ==
[info] :: publishing :: com.thinkminimo.step#step_2.7.7
[info]  published step_2.7.7 to $HOME/.ivy2/local/com.thinkminimo.step/step_2.7.7/1.1.6-SNAPSHOT/jars/step_2.7.7.jar
[info]  published ivy to $HOME/.ivy2/local/com.thinkminimo.step/step_2.7.7/1.1.6-SNAPSHOT/ivys/ivy.xml
[info] == publish-local ==
[success] Successful.

POST is incorrectly allowed on GET-only resource

Given a ScalatraServlet or ScalatraFilter mapping of:
get("/someresource/")

When a client does a POST, PUT or DELETE to said URI, the server will return a 404 Not Found HTTP Code.

It would be more appropriate to return a HTTP 405 Method Not Allowed, given that there is a matching URI mapping for the path, but not a HTTP method to deal with the request.

As mentioned, this affects both Servlet and Filter implementations of ScalatraKernel, so I'm assuming it has something to do with how routes are looked up.

Catching list as a parameter

Scalatra seems to be unable to get a parameter of a post when it is a list.
For instance when the content of the post is this:
mylist%5B%5D=18&mylist%5B%5D=7&mylist%5B%5D=31&mylist%5B%5D=12
params holds:
Map("mylist[]" -> 18)
When it should have:
Map("mylist" -> List(18, 7, 31, 12))

I am generating the post like using something like this:

$.ajax({
type: 'POST',
dataType: 'json',
url: url,
data: {"mylist": mylist},
success: function(data) {
$('.result').html(data);
}});

Intermittent NPE parsing routes

Since porting to sbt-0.10, tests are failing intermittently:

[info] Caused by: org.eclipse.jetty.servlet.ServletHolder$1: java.lang.NullPointerException
[info]  at org.eclipse.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:408)
[info]  at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:454)
...
[info] Caused by: java.lang.NullPointerException
[info]  at scala.util.parsing.combinator.Parsers$NoSuccess.&lt;init&gt;(Parsers.scala:132)
[info]  at scala.util.parsing.combinator.Parsers$Failure.&lt;init&gt;(Parsers.scala:159)
[info]  at scala.util.parsing.combinator.RegexParsers$$anon$2.apply(RegexParsers.scala:67)

sbt-0.10 runs tests in parallel. This smells like thread-unsafe parsers.

README refers to incorrect source files for examples

The README.markdown file mentions:

"Navigate to http://localhost:8080
You should see "Hello world." You can poke around the example code in src/main/scala/StepExample.scala to see what's going on."

However I found the example code was actually located in:
src/main/scala/com/thinkminimo/step/TemplateExample.scala

Scala CPS plugin

import com.ControlContext._
object Example {
def main(args: Array[String]){
reset {
println(1)
shift
{
(cont: Unit => Unit) =>
cont()
cont()
}}}}
This is my code for shift and reset concept. Am compiled in eclipse, Its says "this code has to be compiled with the Scala CPS plugin". How can i debug this error. please save me.

Downloads button is confusing people.

The latest download appears to be 2.8.0RC6-1.2.0, but that's ancient. Make it more clear what the current version is, how to get it, and that the downloads button isn't it.

handling non-URI root servlets

Step breaks when the servlet has a context (URI to) that isn't at the base domain of the servlet container.

I need to do some string fanciness in there to fix it.

my.servlet.com/ <- fine
my.servlets.com/something/ <- broken

sbt won't run on mac os x

dennis [ Sat:07 01:04:58 ] ~/Documents/Workspace/my-app % ./sbt
Exception in thread "main" java.lang.NoClassDefFoundError: //sbt-launch/jar
Caused by: java.lang.ClassNotFoundException: ..sbt-launch.jar
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

FlashMap should be serializable

FlashMap being stored in the session should be serializable. I am not sure the servlet spec states this unless the servlet runs in a distributed environment (see SRV.7.7.2 in the spec). But, for example, on Google App Engine all objects stored in the HttpSession must be serializable.

Adding @serializable to FlashMap seems to be enough.

Add request content setting to ScalatraTests

The whole body of a request can be easily parsed as demonstrated in RequestBodyTest.
In ScalatraTests however there is no way to easily set the content of a request to other than a parameter list.

Something like post ("url", content) in ScalatraTests would be nice to have. That could than set the request.content to given content for example:
val tester = new HttpTester()
tester.setURI(url)
tester.setContent(content)

Documentation for Authentication

It would be great to have some more concrete documentation on the Authentication module. The sample code isn't quite clear enough by itself.

url decoding of utf-8 encode

23:38 beagleGuy: hey guys quick scalatra question.. I'm sending a urlencoded parameter from php
23:38 casualjim: yep
23:39 beagleGuy: and in my get("/") method I'm doing params.getOrElse("param1", "")
23:39 beagleGuy: when I get that parameter is it already url decoded?
23:39 casualjim: yep
23:39 beagleGuy: I'm running into a weird issue with utf8 chars
23:39 casualjim: it's causing me grief atm actually so I can say with certainty that it is in fact decoded
23:40 beagleGuy: gotcha
23:40 beagleGuy: thanks
23:40 beagleGuy: what I'm trying to do is in php send this urlencode("Iñtërnâtiônàlizætiøn Iñtërnâtiônàlizætiøn") as a parameter
23:41 casualjim: we have a spec for that
23:41 beagleGuy: when it comes into my parameter in scalatra it winds up as: Τη γλώσσα μου έδωσαν ελληνική
23:41 casualjim: ok we need a new spec then

Better getting started documentation

Wanted to try out Scalatra, then saw that the documentation tells me to use conscript and giter8, which install into...~/bin? Really? Now I have to pollute a home directory to try out Scalatra? And why are these programs necessary (answer: they're not)?

Would be great to see the non-n8han way of doing things documented.

Launch website at scalatra.org

  • Should include unified Scaladoc (already building)
  • SXR source browser would be cool
  • Need to port Scalate SiteGen plugin to sbt-0.10.x
  • There's a start in the website directory, but has fallen behind the README.

Can't find RailsPathPatternParser

I'd like to use the RailsPathPatternParser in order to be able to have urls like "/:id.json" which I think is not possible with SinatraPathPatternParser. The problem is: I have no idea how to import this class. Can you please update the example in the readme with an appropriate import declaration?
Thank you very much!

Multiple different content-types per step framwork

Currently there is only one content-type per Step Servlet possible (in the before {} instruction).

I need to serve different content types in one Step Servlet (both text/html and text/xml, eventually also json, svg etc ....).

If this would be implemented somewhere in the future this would be great !!!! (I have no clue how, maybe by allowing an additional parameter in the get(), post() etc. command. If the additional parameter is not set then use the global setting.)

Btw: How handles Sinatra this ?

Have Fun !
Rusco

Comet support for step?

Would it be possible to implement comet support with actors for Step or is it already possible somehow?

Failed to run jetty

I was using the scala-2.8 branch and scala-2.8.0-RC2 with sbt-0.7.3
When "jetty-run" was executed in sbt console, the following exception was thrown:

...
[info] == step-example / jetty-run ==
java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Connector
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at sbt.ModuleUtilities$.getObject(ModuleUtilities.scala:10)
at sbt.JettyRunner.createRunner$1(WebApp.scala:46)
at sbt.JettyRunner.runJetty$1(WebApp.scala:48)
at sbt.JettyRunner.apply(WebApp.scala:58)
at sbt.WebScalaProject$$anonfun$jettyRunTask$1.apply(ScalaProject.scala:372)
at sbt.WebScalaProject$$anonfun$jettyRunTask$1.apply(ScalaProject.scala:372)
at sbt.TaskManager$Task.invoke(TaskManager.scala:62)
at sbt.impl.RunTask.doRun$1(RunTask.scala:77)
at sbt.impl.RunTask.runTask(RunTask.scala:85)
at sbt.impl.RunTask.sbt$impl$RunTask$$runIfNotRoot(RunTask.scala:60)
at sbt.impl.RunTask$$anonfun$runTasksExceptRoot$2.apply(RunTask.scala:48)
at sbt.impl.RunTask$$anonfun$runTasksExceptRoot$2.apply(RunTask.scala:48)
at sbt.Distributor$Run$Worker$$anonfun$2.apply(ParallelRunner.scala:131)
at sbt.Distributor$Run$Worker$$anonfun$2.apply(ParallelRunner.scala:131)
at sbt.Control$.trapUnit(Control.scala:19)
at sbt.Distributor$Run$Worker.run(ParallelRunner.scala:131)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Connector
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at xsbt.DualLoader.loadClass(DualLoader.scala:28)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at sbt.LazyFrameworkLoader.doLoadClass(ClasspathUtilities.scala:204)
at sbt.LoaderBase.loadClass(ClasspathUtilities.scala:118)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at sbt.ModuleUtilities$.getObject(ModuleUtilities.scala:10)
at sbt.JettyRunner.createRunner$1(WebApp.scala:46)
at sbt.JettyRunner.runJetty$1(WebApp.scala:48)
at sbt.JettyRunner.apply(WebApp.scala:58)
at sbt.WebScalaProject$$anonfun$jettyRunTask$1.apply(ScalaProject.scala:372)
at sbt.WebScalaProject$$anonfun$jettyRunTask$1.apply(ScalaProject.scala:372)
at sbt.TaskManager$Task.invoke(TaskManager.scala:62)
at sbt.impl.RunTask.doRun$1(RunTask.scala:77)
at sbt.impl.RunTask.runTask(RunTask.scala:85)
at sbt.impl.RunTask.sbt$impl$RunTask$$runIfNotRoot(RunTask.scala:60)
at sbt.impl.RunTask$$anonfun$runTasksExceptRoot$2.apply(RunTask.scala:48)
at sbt.impl.RunTask$$anonfun$runTasksExceptRoot$2.apply(RunTask.scala:48)
at sbt.Distributor$Run$Worker$$anonfun$2.apply(ParallelRunner.scala:131)
at sbt.Distributor$Run$Worker$$anonfun$2.apply(ParallelRunner.scala:131)
at sbt.Control$.trapUnit(Control.scala:19)
at sbt.Distributor$Run$Worker.run(ParallelRunner.scala:131)
[info] == step-example / jetty-run ==
[error] Error running jetty-run: Jetty and its dependencies must be on the test classpath: java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Connector
[info]
[info] Total time: 23 s, completed May 14, 2010 5:25:32 PM

Cannot add dependency 'org.mortbay.jetty#jetty;6.1.22' to configuration 'jetty' of module pod-web#pod-web_2.9.0;1.0 because this configuration doesn't exist!

I'm getting this error doing sbt update:

[error]   {file:/home/yang/pod/sales/web/}default/*:update: java.lang.IllegalArgumentException: Cannot add dependency 'org.mortbay.jetty#jetty;6.1.22' to configuration 'jetty' of module pod-web#pod-web_2.9.0;1.0 because this configuration doesn't exist!

My build.sbt (based on scalatra-sbt.g8):

libraryDependencies ++= Seq(
  "net.databinder" %% "unfiltered" % "0.3.4",
  "net.databinder" %% "unfiltered-filter" % "0.3.4",
  "org.scalaquery" %% "scalaquery" % "0.9.4",
  "postgresql" % "postgresql" % "9.0-801.jdbc4" % "runtime",
  "org.scalatra" %% "scalatra" % "2.0.0-SNAPSHOT",
  "org.scalatra" %% "scalatra-scalate" % "2.0.0-SNAPSHOT",
  "org.mortbay.jetty" % "jetty" % "6.1.22" % "jetty",
  "javax.servlet" % "servlet-api" % "2.5" % "provided->default"
)

scalaVersion := "2.9.0"

fork in run := true

resolvers ++= Seq(
  "Sonatype OSS" at "http://oss.sonatype.org/content/repositories/releases/",
  "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snap
  "Web plugin repo" at "http://siasia.github.com/maven2"
)

Using Scala 2.9.0.1 and sbt 0.10.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.