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
1
vote
0 answers

Change default container in scalatra web application in eclipse

I am a total beginner with developing in scalatra, eclipse, sbt, web services, etc...coming from a proprietary SAP Abap world where everything is different. Recently I found interest in developing in scala and SAP opens its SAP Cloud Platform, so I…
Tapio Reisinger
  • 196
  • 1
  • 8
1
vote
0 answers

logback.xml works find at the local environment, but doesn't work in real server

I'm using scala-based scalatra for web frameworks and I'm having trouble setting up logback.xml. I set my logback.xml file in PROJECT_ROOT/src/main/resources/logback.xml like below logback.xml
yaboong
  • 157
  • 3
  • 18
1
vote
2 answers

how to return custom json in scalatra

Scalatra Code: import org.scalatra._ import org.json4s.{DefaultFormats, Formats} import org.scalatra.json._ class AppServlet extends AppStack with JacksonJsonSupport{ protected implicit lazy val jsonFormats: Formats = DefaultFormats …
Hassan Abbas
  • 1,166
  • 20
  • 47
1
vote
0 answers

Configuring SSL in Scalatra

I've been using Scalatra as a web server and I haven't found any clear instructions on how you're supposed to add ssl certificates/TLS when generating the project using g8. Where do I add the certificate, and what configuration do I have to make to…
rdelfin
  • 819
  • 2
  • 13
  • 31
1
vote
0 answers

Continuous response from REST api

I want to read logs from server until a certain time and return via an api endpoint (e.g., like tail). Since the file can be long, I want to return some output continuously Is it possible to return some output continuously or does one api call only…
Asad Iqbal
  • 3,241
  • 4
  • 32
  • 52
1
vote
2 answers

Tomcat with scalatra Error - NoSuchMethodError HttpServletRequest.getContentLengthLong

I am getting the following error when I try to run a program in Tomcat: java.lang.NoSuchMethodError:…
1
vote
0 answers

Can't use scalatra authentication with latest version 2.5.0

I am trying build a basic authentication demo project with Scalatra. I am not able to find the right dependency for "scalatra-auth". My scala version is 2.11.8. I am bound to use scalatra version 2.2.0 Are there any recent developments in…
Manish Mishra
  • 796
  • 6
  • 21
1
vote
0 answers

Compile pug template in Scala

I am using Scalate in my project. I am trying to compile a simple pug template: html head title Hello body h1 Header Scala Code: val engine = new TemplateEngine engine.layout("temp.pug") And I get error: Exception in thread "main"…
ProNOOB
  • 504
  • 2
  • 14
1
vote
2 answers

How to Parse Json String received from HTTP and loop through the values

I'm using Scala and Swagger and i need help figuring out how to loop through the values in the json and use those values for checking and others. The json string that is returned after HTTP get request looks like this: { "count": 3, "items": [ { …
oneDerer
  • 287
  • 3
  • 10
1
vote
1 answer

Scalatra - File Upload - File Size Too Large Error When It's Not

I'm trying to upload a file using Scalatra Version: 2.4.0. The file I'm trying to upload is only 181 bytes, but I keep getting my file size too large error message, but it's not too large. Everything is compiling and IntelliJ is showing no errors.…
Jeremy Wagner
  • 143
  • 1
  • 11
1
vote
0 answers

Apache Spark: ClassNotFoundException: scala.Some while resolving class JavaSerializer.scala

I am trying to expose an Apache Spark ML code as a REST service using Scalatra. But while calling the GET on the REST endpoint, I receive the following error: java.lang.ClassNotFoundException: scala.Some at …
bjgindia
  • 31
  • 1
  • 7
1
vote
1 answer

Ajax response wait for future (scala)

if I have a Future[A] as a result (the last line) in router's post("/some") path, the Ajax client can't get the response and exceeds a timeout. Await doesn't work. Future onComplete/onSuccess {...} works ok, but for the server, so how to translate…
aepetelin
  • 13
  • 3
1
vote
0 answers

Scalatra set port on http server

I want to use scalatra for my http server mocks, I´m using gradle to run my bdd test. I´ve been reading the documentation but I cannot find a way to specify the port where to listen without use scala.build, but again my problem is that my project…
paul
  • 12,873
  • 23
  • 91
  • 153
1
vote
1 answer

JacksonJsonSupport trait causes a NoSuchMethodError for initialize()

I'm going through the Scalatra "Handling JSON" tutorial for Scalatra 2.4, and I'm getting a "NoSuchMethodError": Exception in thread "main" java.lang.NoSuchMethodError:…
sdanzig
  • 4,510
  • 1
  • 23
  • 27
1
vote
2 answers

sending large files with scalatra server ends after 2^31 - 1 bytes

We are using scalatra with Jetty 9. We are have an endpoint which serves static files. But I've noticed that anything that is greater than 2GB seems to get truncated. I can see that the file gets sent chunked. Curl and wget can properly start the…
jamesatha
  • 7,280
  • 14
  • 37
  • 54