playframework-2.1

Play Framework 2.1.1 Deployment Issues

感情迁移 提交于 2019-12-03 14:11:34
So, I'm trying to deploy my very simple Play Framework 2.1.1 app but whenever I pass flags through the command line for port and to apply database evolutions, they are ignored. For example: sudo play start -Dhttp.port=80 -DapplyEvolutions.default=true Using this command, the server will not start. Both the port and applyEvolutions=true flags are ignored completely and it throws this error: [warn] play - Your production database [default] needs evolutions! [warn] play - Run with -DapplyEvolutions.default=true if you want to run them automatically (be careful) Oops, cannot start the server.

How to create sub projects in Play Framework? (play#play-java_2.9.2;2.1-RC3: not found)

旧城冷巷雨未停 提交于 2019-12-03 12:57:07
I want to test how sub projects work, especially how the routes of the sub project are taken into account in main project ( this was not visible before ). I have read the docs here: https://github.com/playframework/Play20/wiki/SBTSubProjects What have I done: (after downloading play 2.1 RC3) Create new Java Project: play new MainProject Create new folder inside MainProject: modules Create new Java Project: play new SubProject On both projects: play eclipse since play eclipsify does not work anymore In the main projects Build.scala file: import sbt._ import Keys._ import play.Project._ object

IllegalStateException: impossible to get artifacts when data has not been loaded for Guava 12.0?

房东的猫 提交于 2019-12-03 09:24:01
In a Java Play 2.1.1 app I get the following error: [myproject] $ update [info] Updating {file:/C:/path/myproject/}myproject... [info] Resolving ... [error] impossible to get artifacts when data has not been loaded. IvyNode = com.google.guava#guava;12.0 [error] (*:update) java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. IvyNode = com.google.guava#guava;12.0 [error] Total time: 230 s, completed 17.05.2013 19:16:41 Build.scala "com.google.guava" % "guava" % "14.0.1", "org.mydependency" % "mydependency" % "1.0-SNAPSHOT" changing() exclude("org.jboss

Play framework template automatically imports models._ among other things

柔情痞子 提交于 2019-12-03 08:48:50
It seems like in Play framework templates, there is an implicit "@import models._" and "@import play.api.data.Form" because my code: @(title: String)(myForm: Form[User]) <!DOCTYPE html> <html> .... </html> works without having to put explicit import statements after the first line. This issue has been raised in the past: https://groups.google.com/d/msg/play-framework/7FT68jd5asU/xYF0VNySJYcJ What other classes/objects are implicitly imported? You're right, Play Framework automatically add some import statements to all templates. You can find these "default imports" in the PlaySettings trait

Managing evolutions in production environment

[亡魂溺海] 提交于 2019-12-03 08:11:10
问题 We are in the process of deploying a new application using play 2.1.1 to production and are having some real issues with it and the very limited documentation didn't help much... So it was time to update to a new version, we ran our usual stop/upgrade/start scripts but they failed. For some reason, play was refusing to apply the evolutions. When starting it kept saying Oops, cannot start the server. @6elnj89fh: Database 'default' needs evolution! This was even though we tried setting

How can I specify a different config file for testing in Play 2.1

允我心安 提交于 2019-12-03 07:24:51
问题 I would like to define different database connections for multiple test environments(Production, Staging, Development). After reading the post "How do I specify a config file with sbt 0.12.2 for sbt test?" it seems that it was possible in earlier versions of Play, by using the follwing SBT setting: val main = play.Project(appName, appVersion, appDependencies).settings( javaOptions in Test += "-Dconfig.file=conf/test.conf" ) But if I use this setting in my Build.scala, I get the following

Local dependencies resolved by SBT but not by Play! Framework

☆樱花仙子☆ 提交于 2019-12-03 07:24:39
I'm trying to use banana-RDF, a locally published library (published using SBT's publish-local ) from a Play! Framework project, but when running compile from Play's console, the wanted library is not resolved, when using compile from SBT's console everything goes fine. I find this behavior pretty weird as Play uses SBT to resolve dependencies. By the way, I'm using the 0.12.3 version of SBT in my Play project. The error I'm getting when compiling with Play is pretty basic: [warn] module not found: org.w3#banana_2.10;2013_02_21-SNAPSHOT [warn] ==== local: tried [warn] /home_local/

iterate over case class data members

落爺英雄遲暮 提交于 2019-12-03 07:22:20
问题 I am writing a play2.1 application with mongodb, and my model object is a bit extensive. when updating an entry in the DB, i need to compare the temp object coming from the form with what's in the DB, so i can build the update query (and log the changes). i am looking for a way to generically take 2 instances and get a diff of them. iterating over each data member is long, hard-coded and error prone (if a.firstName.equalsIgnoreCase(b.firstName)) so i am looking for a way to iterate over all

Playframework settings depending on environment

前提是你 提交于 2019-12-03 01:08:48
I'm using playframework 2.1-RC2. First of all I've seen all the similar questions , so I followed the common instruction of separating application.conf file per environment. So I have application.test.conf and I run tests this way: play -Dconfig.file=./conf/application.test.conf "test" I tried different combinations, like play -Dconfig.file=./conf/application.test.conf ~test or play -Dconfig.file=conf/application.test.conf ~test Still no luck, it just does not get picked, default one (application.conf) is instead. From the other side, if I do play -Dconfig.file=./conf/application.dev.conf "run

iterate over case class data members

雨燕双飞 提交于 2019-12-02 22:09:57
I am writing a play2.1 application with mongodb, and my model object is a bit extensive. when updating an entry in the DB, i need to compare the temp object coming from the form with what's in the DB, so i can build the update query (and log the changes). i am looking for a way to generically take 2 instances and get a diff of them. iterating over each data member is long, hard-coded and error prone (if a.firstName.equalsIgnoreCase(b.firstName)) so i am looking for a way to iterate over all data members and compare them horizontally (a map of name -> value will do, or a list i can trust to