Questions tagged [playframework-2.0]

Play Framework 2.0 is a major revision of Play, a Ruby on Rails-like framework for the Java platform. Version 2.0 introduces features such as the use of Scala language, Akka actors, Scala templates and a build system (SBT).

playframework-2.0
1,637 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
55 views

Is there a way to squash evolutions in the Play framework?

What is the recommended way to manage evolutions in Play, when the number of evolution scripts becomes one too many? Is it recommended practice to squash evolutions into a single file, say 1.sql, and ...
prvnsmpth's user avatar
  • 305
4 votes
0 answers
4k views

HttpOnly cookie and XSRF-TOKEN in angular js

I have an angular js web application with play framework as server side. I am using Google plus sign-in button to authenticate users. I need to authenticate all my ajax calls in the server side. After ...
DBS's user avatar
  • 814
4 votes
0 answers
546 views

Play framework does not automatically reload on changes when running on virtual machine

The problem I am using the Play Framework, and I am doing so on a virtual machine. However Play does not recompile on changes in dev mode. I have tried using run and ~run in the activator console. ...
ogroendal's user avatar
  • 353
4 votes
0 answers
374 views

IntelliJ IDEA and Play Framework very slow

I am using IDEA 15 for a Play! 2 Application, but I am having problems that the compiler seems to get stuck. Generally when I change a file and save it compiles in a second and I can test. But often ...
Luuk D. Jansen's user avatar
4 votes
0 answers
128 views

Could not instantiate controllers.WebJarAssets during testing

Play is working fine when I am using sbt run. However, when I am trying to do such test: @RunWith(classOf[JUnitRunner]) class MarketApiSpec extends Specification { "Market API" should { "load ...
Dawid Pura's user avatar
  • 1,001
4 votes
0 answers
517 views

play framework can't read cookie and can't parse request header

play framework can't read cookie and can't parse request header. the error logs are these: [play.api.mvc.Cookies$$anonfun$decodeSetCookieHeader$2]- Couldn't decode the Cookie header containing: [play....
youhans's user avatar
  • 6,551
4 votes
1 answer
1k views

Timeout resolving sbt-plugin

I'm trying to run a simple play-scala example, but I've some problem launching activator because I have a lot of connection timeout. I've only created the application with activator and tried to ...
Mikyjpeg's user avatar
  • 1,209
4 votes
0 answers
238 views

Scala 2.11 Macros - Parse JDBC row to case class

I'm trying to make a macro for my Play Framework project (2.3.7). I'm trying to make it easy to map an anorm Row to a case class. When I try to compile the attached code, I am getting the following ...
Sean Freitag's user avatar
4 votes
1 answer
127 views

Scala: def vs val in Play2

I have been following the instruction in the Play! Framework Essentials book, and sometimes I see an action in controllers defined with a def, and sometimes with a val. I know that def will ...
Khanetor's user avatar
  • 12k
4 votes
0 answers
399 views

Intellij IDEA, scala, show all errors

I cannot get any useful error reporting in IDEA 14. Errors are nicely underlined but it would be nice if I could somewhere see a collection of all the errors I have in my code. Problems monitor is ...
Lovro Gregorčič's user avatar
4 votes
0 answers
829 views

Play Framework: Sending request.body to WS using WS.put for any content type (maybe using byteArray?)

I have an api endpoint that takes in a put request for a file, authenticates it and sends the authenticated request to a remote web server endpoint. I am using play's WS object to make the remote put ...
pinkGirl's user avatar
4 votes
0 answers
591 views

How to avoid re-login using securesocial on play framework 2?

I am using "SecureSocial" for authentication in my project. I have an issue which have been halfly answered on stack overflow, Whenever I refresh my project (because of a file change,etc), I have to ...
Hossein's user avatar
  • 41k
4 votes
0 answers
532 views

Play 2.x and multi-tenancy

I'm implementing a multy-tenant application with Play Framework 2.0. For that I added to eban configuration two adapters: public class TenantBeanQueryAdapter implements BeanQueryAdapter { ... ...
dvilchez's user avatar
4 votes
1 answer
825 views

Play framework - overwrite onRouteRequest in java

I would like to bypass play 2 routes and return my own handler in Global, looking for help on how can we do that. Preferably in Java, but if thats not possible, scala is fine. public Handler ...
TechArtandBeer's user avatar
4 votes
1 answer
497 views

Gzip chunked response in play framework

Does anybody know how to compress chunked response on play framework 2.2.1? I have gzipFilter which perfectly compress regular content, however doesnt compress chunked responses. My code is pretty ...
Viktor Aseev's user avatar
4 votes
1 answer
236 views

Asynchronous input validators in Play2

I am using play2.1 and I need a validator which checks if a given name is already taken or not in MongoDB. I am using reactive mongo which is an asynchronous MongoDB driver, although my question doesn'...
Ali Salehi's user avatar
  • 6,979
4 votes
1 answer
858 views

"play test" classpath differs from "sbt test" classpath

Situation: I want to execute JUnit test cases for my Play! 2.0 application on a Jenkins Server. To build and test my app on the server I want to use SBT (with command sequence: clean compile test). ...
cnmuc's user avatar
  • 6,115
4 votes
1 answer
547 views

play2 does not resolve messages when run from a unit test

I'm trying to run unit tests for the Play 2 based application, and we are having some issue regarding the Messages. Apparently, this one seams to not properly initialize or not initialized at all. @...
reljicb's user avatar
  • 91
4 votes
1 answer
1k views

Kerberos authentication in Play framework 2.1

I went through the Play Framework for rapid prototyping of Java web apps. The project seems to be just what I need for rapidly building a Java based CRUD application at my work. However, one critical ...
ragebiswas's user avatar
  • 3,838
4 votes
1 answer
1k views

Play framework 2, AngularJS and internationalization

I'm currently implementing AngularJS in a Play framework 2 application, and it's good so far, but I'm facing some problems with internationalization. I have my messages files (messages.en, messages.fr,...
Lebowski's user avatar
  • 598
4 votes
2 answers
438 views

Typesafe stack not get project template - Exception fetching from github Unexpected response code: 403

I'm trying typesafe stack. Yesterday, I can get project template of typesafe stack. $sudo g8 typesafehub/akka-java-maven Today: I can't get project template. $sudo g8 typesafehub/play-java Error: ...
Nguyen Ba Tan's user avatar
4 votes
0 answers
283 views

"no suitable constructor found" Compilation error in case of varargs

I continuously have the same error of error: no suitable constructor found for FootballCriterionSet(String,FootballCriterion,FootballCriterion) in case of constructor with varargs: public ...
Leo's user avatar
  • 2,127
4 votes
1 answer
471 views

IntelliJ 12: Showing Play 2.1 / Scala compile errors in Project navigator?

I have IntelliJ 12 Ultimate and am using the Play Framework 2.1 with Scala (love them both) One thing I miss from Eclipse is seeing my project files annotated with a red mark if they fail to compile. ...
Chris Beach's user avatar
  • 4,352
4 votes
1 answer
956 views

Play 2.0 fails to resolve javax.ws.rs/jsr311-api/1.1.1

I'm trying to compile an existing project on Play 2.0.4 on my new environment Windows 8. On resolving dependency, Play cannot find javax.ws.rs#jsr311-api;1.1.1!jsr311-api.jar. Here is the error code ...
Benjamin Canac's user avatar
4 votes
1 answer
811 views

Play session cookie not sent by Safari

I have a single page application (SPA) on a domain a.domain.com (http) that connect to an api on b.otherdomain.com (https) build in Play 2 (scala). After the loading of the SPA, the user enter is ...
Go4It's user avatar
  • 561
4 votes
1 answer
1k views

How to force Ebean to do a Left join, not a join?

With PlayFramework, I use Ebean to make a query where the OneToMany are null, but Ebean generate a simple "JOIN" query, that returns no rows. If a change it to "LEFT JOIN" in MySQL, it works, but I ...
Cyril N.'s user avatar
  • 39.5k
4 votes
1 answer
2k views

Can I use socket.io with Play Framework 2.0 Web Sockets?

There's a sample application that comes with Play Framework 2.0. The application uses Play's WebSocket implementation on the server side. I am wondering can I use socket.io on the client side to ...
jsf's user avatar
  • 2,921
4 votes
1 answer
400 views

Securing Play's REST APIs

I am trying to use Play 2.x with backbone.js for a project. My intention is to create RESTful APIs at the server end (all response bodies are in JSON and all request bodies are in JSON also). I ...
rOrlig's user avatar
  • 2,499
4 votes
1 answer
182 views

Multiple REST interfaces in Play! 2 application

We have a Play! application where we need to expose a set of REST interfaces to an intranet and a set of REST interfaces we have to expose to the public internet. They share a data layer so we would ...
csbricker's user avatar
4 votes
1 answer
761 views

Play dependencies on a scala project

I am trying to get a play project to have another local scala project as a dependency. I have the local scala project deploying to my local M2 repository with this line in my configuration file. ...
Caelrin's user avatar
  • 95
4 votes
1 answer
329 views

How does one do instance level model validation in Play 2?

I need some complex validation logic which would be across multiple fields. Is there a way to do this every time save() or update() on a model is called? I m currently using Ebean as my ORM. The only ...
ankimal's user avatar
  • 925
4 votes
1 answer
2k views

Is there a play2 framework plugin to build OAuth REST API?

I would like to build a web service (RESTful JSON API) and I would like to secure my API with OAuth 1.0 or 2.0. I'm using Play2 with Scala and I cannot find examples on writing OAuth providers (not ...
Ahmed Farghal's user avatar
4 votes
1 answer
757 views

Play 2.x null-safe coalescing (avoiding NPEs in templates)

In Play 1.x you could do things like &{task?.server?.name} to print the server name if it exists or to print nothing if task or task.server were null. How can I get the same result in the 2.x ...
Brad Mace's user avatar
  • 27.6k
4 votes
1 answer
1k views

HTTP Context for testing in Java Play! 2.0.2

We're trying to write tests for our views, but some of them require session variables to properly render. This is what a standard test looks like: @Test public void indexTest() { running(...
nicohvi's user avatar
  • 2,270
4 votes
0 answers
2k views

Mongodb Java Driver fails to read data sporadically, socket timeout

I am trying to use the Mongodb driver for java and I have been getting very frustrated with this bug that appears very sporadically, though most consistently, it appears when I am first trying to ...
wfbarksdale's user avatar
  • 7,546
4 votes
1 answer
1k views

Downloading csv file using Play Framework?

I want to add to my app a simple button that on click will call an Action that will create a csv file from two lists I have and download it to the user computer. This is my Action: def ...
jack miao's user avatar
  • 1,448
4 votes
1 answer
1k views

Using isProd and isDev in scala twirl templates in Play Framework 2.5

I'm migrating an Play 2.4 application to 2.5 and now play.Play.application().isProd is deprecated. I use this in various places in scala.html templates. (To decide weather or not to use minimized ...
Sindri Traustason's user avatar
4 votes
1 answer
2k views

Play 2 - The default EBean server has not been defined

Hi I am getting the above error when I attempt to save a Model object. Here are the relevant parts of my Application.conf file: # Database configuration # ~~~~~ # You can declare as many datasources ...
Imran's user avatar
  • 413
3 votes
0 answers
34 views

Cannot load grand-child routing from child module

Play Version [email protected] JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing) $ java -version openjdk version "1.8.0_212" OpenJDK Runtime Environment (Zulu 8.38.0.13-CA-linux64) (build 1.8.0_212-b04)...
sizer's user avatar
  • 119
3 votes
1 answer
298 views

what schema evolution should I use while using quill-async-mysql and play 2.6?

Im using quill-async-mysql in my project, and I have a simple db setup in my application.conf: quilldb { host = 127.0.0.1 port = 3306 user = root password = "" database = MyDatabaseName } ...
Jack Nicolsen 's user avatar
3 votes
0 answers
141 views

Output of Clojure Compiler in SBT Project

tl;dr: Unexpected layout of .class files produced by clojure compiler invoked from scala code. I have an SBT project (using playframework) that includes some clojure code. The clojure compiler is ...
Thomas Matecki's user avatar
3 votes
0 answers
177 views

not found: value restrict deadbolt play framework

Im using play 2.6.5 and deadbolt 2.6.1 java. I am trying to add @restrict() {} but does not work. im add the import @import be.objectify.deadbolt.java.views.html.di.{restrict} but all time say me ...
chatzich's user avatar
  • 1,083
3 votes
0 answers
766 views

Scala Play with Dotty

I've been having a look on how to get existing projects to use the Dotty compiler. This has been straightforward for small projects following this. https://github.com/lampepfl/dotty-example-project ...
Oliver Shaw's user avatar
  • 5,314
3 votes
0 answers
54 views

why I cant extend playFrameworks NingWSComponents? (play 2.6.0)

From what I understand, to use WSClient instance you need to mix NingWSComponents, like this guy answer here how to inject dependencies to a service with MacWire (play framework). But this dosent ...
jack miao's user avatar
  • 1,448
3 votes
0 answers
432 views

Run async task from sbt with Play 2.4.2 framework

I'd like to be able to execute a short routine written in scala (or java) within Play Framework environment. I want to be able to work with models backed with my production database. note: I know ...
Patrik Beck's user avatar
  • 2,495
3 votes
0 answers
238 views

akka scheduler hang on play application reload

When working locally play framework reload on every code change. In my case the app hang. I found out when debugging, that akka scheduler is stuck executing one of the Runnables. class ...
Tomer's user avatar
  • 2,408
3 votes
0 answers
474 views

NPM integration doesn't seem to work in Play Framework

There is a paragraph in the documentation that says : npm can be used as well as WebJars by declaring a package.json file in the root of your project. Assets from npm packages are extracted into ...
Clément Poissonnier's user avatar
3 votes
0 answers
2k views

Using Play WS and getting java.net.ConnectException: handshake timed out on Amazon Cloudfront

Within my Play application I need to download a large number of files from Amazon Cloudfront. Using SSL I'm getting the following error randomly on a link: play.api.http.HttpErrorHandlerExceptions$$...
Jork's user avatar
  • 476
3 votes
0 answers
366 views

Play framework error while creating a SOAP service using (play version 2.5.4 + Java )

I am new to play framework. I need to create a soap service in play framework using java. I followed this article but was not able to run the application - activator/play version - 2.5.4 While ...
kranthi's user avatar
  • 31
3 votes
1 answer
175 views

Play 2.5.x (Scala) -- How does one put a value obtained via wsClient into a (lazy) val

The use case is actually fairly typical. A lot of web services use authorization tokens that you retrieve at the start of a session and you need to send those back on subsequent requests. I know I ...
Techmag's user avatar
  • 1,381

1
2
3 4 5
33