I pulled the Scalatra examples from Github and ran the Swagger example for Scalatra version 2.3. The example runs, but the API documentation is not generated completely. I was using the example as is. Continue reading
I am running Scala version 2.11.1 and Scalatra version 2.3.0 and had a strange problem that plain vanilla halt does not work when the trait
JacksonJsonSupport is mixed in with my controller class. Here are two simpel code snippets to illustrate the problem. Continue reading
In SBT it is possible to automatically recompile and reload a web app when a source file is changed by using the following command:
container:start ~ container:reload /
The first command starts the web app container the second command watches for source file changes and reloads the web app container.
Seriously? Unsupported major.minor version 51.0 when compiling a Scalatra project? The complete error is “Caused by: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/server/Handler : Unsupported major.minor version 51.0”. After some Googling I found the following statement “You are using different JDK versions to compile and run the application”. No way, that is not possible. Continue reading
Scalatra is a micro framework for Scala. Installation does not seem to be as straight forward as adding Scalatra to the dependencies of build.sbt. It requires a number of other tools to work: Conscript and giter8. Conscript is a tool for installing and updating Scala code. giter8, which depends on conscript, allows you to check out project templates directly from Github. It’s the recommended way to generate Scalatra project skeletons. These are quick installation instructions for Scalatra on Windows. Continue reading
Grrrr, just cloned some of my code from Github to my laptop. I initially worked on this code on my desktop. When I tried to compile it in sbt I got the following error
sbt.ResolveException: unresolved dependency: com.typesafe.play#play-json_2.11;2.3.0: not found. It had been a while since I worked on the code so I was puzzled. It turns out there are problems with the Typesafe repository. As a workaround the repository needs to be added as a resolver to the build.sbt file.
resolvers += "Typesafe Maven Repository" at "http://repo.typesafe.com/typesafe/maven-releases/"
After this it compiled nicely. Sweet. Happy coding 🙂
I wanted to add a license header to my Scala source code files. It turns out there is a neat sbt plugin called sbt-license-plugin that does just that. Getting it to work took some fiddling around, so I thought I would share it here to save someone else the time and trouble. Continue reading