playframework-2.4

How to use a path relative to project root to H2 db-file configuration with Play Framework 2.4?

。_饼干妹妹 提交于 2020-11-25 07:28:05
问题 We're developing a Play 2.4 application (Java API). For dev purposes, we'd like to use a persistent H2 database with DB file path relative to the project root directory. In How to use a persistent H2 database in the Play Framework instead of in-memory there was solution for Play 2.0: db.default.url="jdbc:h2:file:data/db" However, with Play 2.4 this doesn't seem to work but I get error message with the following exception at the bottom: Caused by: org.h2.jdbc.JdbcSQLException: A file path that

Play framework, i18n “messages.*” in subfolders

不想你离开。 提交于 2020-06-17 06:59:32
问题 I want to put conf/messages into subfolder, like conf/lang/messages . There is nothing about this in documentation: https://www.playframework.com/documentation/2.4.x/JavaI18N. Did someone resolve this problem ? 回答1: This Messages.scala source code has a clue: protected val messagesPrefix = config.getDeprecated[Option[String]]("play.i18n.path", "messages.path") I have not tried it in 2.4 yet, but it looks worth taking for a spin. 回答2: You can specify the sub-directory in application.conf by

Play framework, i18n “messages.*” in subfolders

只谈情不闲聊 提交于 2020-06-17 06:59:15
问题 I want to put conf/messages into subfolder, like conf/lang/messages . There is nothing about this in documentation: https://www.playframework.com/documentation/2.4.x/JavaI18N. Did someone resolve this problem ? 回答1: This Messages.scala source code has a clue: protected val messagesPrefix = config.getDeprecated[Option[String]]("play.i18n.path", "messages.path") I have not tried it in 2.4 yet, but it looks worth taking for a spin. 回答2: You can specify the sub-directory in application.conf by

Compilation error - package does not exist - Java

倖福魔咒の 提交于 2020-01-24 09:07:45
问题 I have the following file structure: root-folder --.idea --folder1-java-console-application (module 1) ----src ------main/java/my/package/App.java ----pom.xml --folder2-play-framework-2-ui (module 2) ----app ------controllers --------Application.java Application.java depends on my.package.App.java . So, I import this package like this: Application.java: import my.package.App; public class Application extends Controller { public static Result index() { return ok(index.render("Your new

Compilation error - package does not exist - Java

非 Y 不嫁゛ 提交于 2020-01-24 09:07:44
问题 I have the following file structure: root-folder --.idea --folder1-java-console-application (module 1) ----src ------main/java/my/package/App.java ----pom.xml --folder2-play-framework-2-ui (module 2) ----app ------controllers --------Application.java Application.java depends on my.package.App.java . So, I import this package like this: Application.java: import my.package.App; public class Application extends Controller { public static Result index() { return ok(index.render("Your new

ProvisionException: Unable to provision, in play framework

不想你离开。 提交于 2020-01-15 06:29:08
问题 I am getting these error ProvisionException: Unable to provision, see the following errors: com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) Could not find a suitable constructor in models.factory.FactoryHandler. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private. at models.factory.FactoryHandler.class(FactoryHandler.scala:7) while locating models.factory.FactoryHandler for

Play 2.4 Finder throws Null Pointer Exception

给你一囗甜甜゛ 提交于 2020-01-06 07:45:52
问题 I'm currently having an issue with a Finder instance in Play 2.4 whereby it returns a null pointer exception when used. Here is the code trying to use it public ExpressionList<ClientAuthorization> getAuthorizationQuery(String appId) { return ClientAuthorization.find.where().eq("app_id", appId).eq("active", 1); } And the model class package models; import com.avaje.ebean.Model; import javax.persistence.*; import java.sql.Timestamp; @Entity @Table(name="client_authorization") public class

Play Anorm insert a scala List into a postgres text array column

蓝咒 提交于 2020-01-04 05:37:13
问题 I'm trying to insert a List[String] into a postgresql column of type text[]. I believe when you attempt to insert any List, Anorm inserts each member of the List in its own column. I'm pretty sure this is the case because I get back the exception: org.postgresql.util.PSQLException: ERROR: INSERT has more expressions than target columns What I want to do is insert the entire List as a text[]. My current code: def insertList(listName: String, subLists: List[String]): Long = { DB.withConnection

Play Anorm insert a scala List into a postgres text array column

放肆的年华 提交于 2020-01-04 05:37:06
问题 I'm trying to insert a List[String] into a postgresql column of type text[]. I believe when you attempt to insert any List, Anorm inserts each member of the List in its own column. I'm pretty sure this is the case because I get back the exception: org.postgresql.util.PSQLException: ERROR: INSERT has more expressions than target columns What I want to do is insert the entire List as a text[]. My current code: def insertList(listName: String, subLists: List[String]): Long = { DB.withConnection

Caused by: java.sql.SQLException: JDBC4 Connection.isValid() method not supported

烂漫一生 提交于 2020-01-03 13:06:48
问题 My play-framework project is running well in my local but when I am trying to deploy it in heroku I am getting following error. 2015-07-05T06:24:10.456657+00:00 app[web.1]: at com.google.inject.Guice.createInjector(Guice.java:73) 2015-07-05T06:24:10.456817+00:00 app[web.1]: at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93) 2015-07-05T06:24:10.456702+00:00 app[web.1]: at com.google.inject.Guice.createInjector(Guice.java:62) 2015-07-05T06:24:10.456746+00