Questions tagged [scalatra]

Scalatra is a tiny Scala web framework, inspired by Sinatra.

Scalatra is a microframework written in Scala. It is a port of the Sinatra framework written in Ruby. Scalatra can be expanded into a minimal but full-featured model-view-controller web framework.

Website: http://scalatra.org/

Source: https://github.com/scalatra/scalatra

309 questions
2
votes
1 answer

Scalatra and Mongo insertOne error - java.lang.NoSuchMethodError: com.mongodb.operation.MixedBulkWriteOperation.bypassDocumentValidation

After pouring through tutorials and help sites for two days, I cannot seem to find the answer to my question. I'm new to Scala and Mongo and I'm building an HTTP server using Scalatra (v2.4.1), Scala (v2.11.8) and the mongo-scala-driver…
Russ
  • 623
  • 8
  • 14
2
votes
1 answer

Serialisation of Java and Scala objects with Scalatra

I inherited a legacy Scalatra application which offers a REST API. The serialisation of the returned object works perfectly if the returned object is a case class build on other case classes. But if return a object created from a Java or Scala class…
Oliver
  • 3,815
  • 8
  • 35
  • 63
2
votes
2 answers

How to use Scalatra with Java8 LocalDateTime

We are using Scalatra 2.4 with JacksonJsonSupport 3.3 and are having problems serializing Java8 LocalDateTime. It is failing with "No constructor for type LocalDateTime, JObject(List())" I've tried a bunch of searches to find a resolution; with…
John Dilley
  • 123
  • 8
2
votes
1 answer

How to Install conscript in Windows

Conscript is needed for giter8 to check out project templates directly from Github and as Scalatra.org states is recommended way to generate Scalatra project skeletons. When conscript-0.4.4.jar is ran error "Error downloading sbt-launch-0.13.0…
Arian
  • 157
  • 9
2
votes
1 answer

Scalatra Set Response Headers

I am trying to set response headers during post request. While everything compiles properly, headers are not set. Here is my code: post("/get_value"){ val jsonString = request.body; response.setHeader("Access-Control-Allow-Origin", "*") …
nietsnegttiw
  • 371
  • 1
  • 5
  • 16
2
votes
2 answers

How to change jetty port for Scalatra

I see in numerous places phrases like: Changing the port in development Add port in container.Configuration := 8081 to project/build.scala But where in build.scala? Here is the vanilla build.scala. It is unclear where that addition should…
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
2
votes
1 answer

Trying to compile a project with Scalatra and failing

I'm starting a new project using Scalatra and when trying to build the process the compiler says: [info] Compiling 13 Scala sources to /home/mauricio/projects/scala/id2-search-proxy/target/scala-2.11/classes... [error] missing or invalid dependency…
Maurício Linhares
  • 39,901
  • 14
  • 121
  • 158
2
votes
2 answers

sbt-web asset output directory setup

Scenario I have a fairly simple Scalatra project with Scala.js and LESS for which I need to create an sbt build configuration. The project is separated into three parts: jvm, js, shared code. My current build config uses xsbt-web-plugin for WAR…
Athelionas
  • 181
  • 3
  • 12
2
votes
1 answer

Why does an sbt project with ScalaVersion set to a 2.11 load 2.10 as well

Following is the core of the project/build.sbt for a scalatra/spark project : val ScalaVersion = "2.11.6" val ScalatraVersion = "2.4.0-RC2-2" // ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true)} lazy val project =…
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
2
votes
2 answers

How to change HTTP status code of AsyncResult using Scalatra

I have created a simple controller (the code below is obfuscated and simplified, assume ask returns a future with a message). What I am trying to do is change the HTTP code from something other than 200 (based on the actor result). When executing…
marteljn
  • 6,446
  • 3
  • 30
  • 43
2
votes
2 answers

Switching from Scalatra to Spray : Handling notFound and errors in spray?

We were Scalatra users. Everytime we would create a servlet , we would extend our BaseServlet which extend ScalatraBase : trait BaseServlet extends ScalatraFilter with ScalateSupport with FlashMapSupport { /** * Returns the…
joanOfArc
  • 467
  • 1
  • 6
  • 16
2
votes
1 answer

ObjectId is not serialized to JSON

I am using scalatra and configured my servlet to always return JSON (as described in the respective guide). Using the MongoDB and Salat leads me to the point where I read a MongoDBObject back into my case class - which seems to work great. My case…
eventhorizon
  • 2,977
  • 8
  • 33
  • 57
2
votes
1 answer

Serializing Nones with json4s in a case class

I can't figure this out, Say I have a case class with Options in it like: case class Note(id: Int, noteA: Option[String], noteB: Option[String]) If I attempt to serialize it to json using json4s as proscribed by the Scalaltra guides, any Nones in…
awfulHack
  • 857
  • 1
  • 10
  • 25
2
votes
2 answers

How to instruct gradle's scala plugin to pick specific JVM among installed ones?

I want to run scala compilation with specific JVM. I'm using Scalatra, and my default JVM is 1.8. With such setup, I run into this problem: Compilation failed: error while loading AnnotatedElement, ConcurrentMap, CharSequence from Java 8 under Scala…
amorfis
  • 15,390
  • 15
  • 77
  • 125
2
votes
1 answer

Scalatra could not find or load main class

I have hello world scalatra application. I added scalatra-sbt plugin and: val myDistSettings = DistPlugin.distSettings ++ Seq( mainClass in Dist := Some("WebServerLauncher"), memSetting in Dist := "2g", permGenSetting in Dist :=…
0xAX
  • 20,957
  • 26
  • 117
  • 206