playframework

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 change RUNNING_PID file path

a 夏天 提交于 2020-01-15 03:55:10
问题 I am trying to store the RUNNING_PID file at /var/run instead of root directory. Tried all the options suggested at: Another SO question about the subject and the solution play suggest in their documnetation: Play additional configuration Yet when I start my app the RUNNING_PID file is created in root directory and the /var/run/play.pid remains empty 回答1: Put play.server.pidfile.path=/var/run/RUNNING_PID in your application.conf 来源: https://stackoverflow.com/questions/35149196/play-change

Play framework [2.5.0 java] - Blocked netty-event-loop threads resulting in timeout

一个人想着一个人 提交于 2020-01-14 19:38:46
问题 We have just upgraded from Play framework 2.4.3 to 2.5.0 (java). However, after upgrading, our tests start getting timeout after a couple of minutes. Before the upgrade they ran for an hour without errors. It looks like some threads are getting blocked, and the system simply stops responding. I am running a smaller version of the load test locally on my machine, with Yourkit java profiler. Initially, there are 16 netty-event-loop threads started. After about a minute, I can see that they have

Play sub-projects do not compile

回眸只為那壹抹淺笑 提交于 2020-01-14 18:51:50
问题 Here is the layout of my multi-project Play 2.2 application - I'm still trying to convert to build.sbt: myApp + app + build.sbt + conf | + routes + project | + build.properties | + Build.scala | + plugin.sbt + modules + myModule + app + build.sbt + conf + routes myApp/build.sbt: name := "myApp" version := "1.0-SNAPSHOT" organization := "com.mydomain" lazy val myModule = project.in(file("modules/myModule")) lazy val main = project.in(file(".")).dependsOn(myModule).aggregate(myModule) play

Play sub-projects do not compile

為{幸葍}努か 提交于 2020-01-14 18:51:07
问题 Here is the layout of my multi-project Play 2.2 application - I'm still trying to convert to build.sbt: myApp + app + build.sbt + conf | + routes + project | + build.properties | + Build.scala | + plugin.sbt + modules + myModule + app + build.sbt + conf + routes myApp/build.sbt: name := "myApp" version := "1.0-SNAPSHOT" organization := "com.mydomain" lazy val myModule = project.in(file("modules/myModule")) lazy val main = project.in(file(".")).dependsOn(myModule).aggregate(myModule) play

What data type does ebean map to BYTEA?

蓝咒 提交于 2020-01-14 14:49:11
问题 I have a Play! 2.0.2 application that needs to store some files in the database. we are using Ebean for our ORM. I believe I need a BYTEA column in my database to store the file, but I'm not sure what data type to use in my model. Should I be using some kind of Blob ? Or just a byte[] ? Or is there another data type I should be using? Thanks! 回答1: To create blob with Ebean you need to use byte array with @Lob annotation @Lob public byte[] image; You'll need to convert between File <-> byte

Why do i need Scala compiler at runtime? (Play2/Salat with Scalap dependency)

 ̄綄美尐妖づ 提交于 2020-01-14 13:35:12
问题 I'm using Scala / Mongo / Casbah / Salat / Play2 and when i try to use Salat it seems it has a dependency to Scalap. It works fine when running the application with play run but with play start i get the following stack: [info] application - Can't create user java.lang.NoClassDefFoundError: scala/tools/nsc/util/ClassPath$JavaContext at scala.tools.scalap.scalax.rules.scalasig.ScalaSigParser$.scalaSigFromAttribute(ScalaSig.scala:35) ~[scalap-2.9.1.jar:na] at scala.tools.scalap.scalax.rules

Play! Framework: How do I lookup an item from a “slugify()” url?

守給你的承諾、 提交于 2020-01-14 12:54:12
问题 The play framework has a function in the view to create an SEO friendly URL via the slugify() function. There does not seem to be an "unslugify" function, so how do you lookup models from the slugified parameter? If for instance I have a Blog model which has a title property set to "hello world", slugify would produce "hello-world". If I then perform a query Blog.find("byTitle", title) where title is the slugified title, it will return no results. How can you lookup a model using the provided

How to add AND to the join SLICK

穿精又带淫゛_ 提交于 2020-01-14 09:53:07
问题 I have the problem writing query in SLICK Here is my request to MySql database: SELECT * FROM readings AS r JOIN parameters AS p LEFT JOIN sensorvalues AS sv ON sv.parameter_id=p.id AND sv.reading_id=r.id How can I write it using SLICK ? It is really lack of info on joins in docs. UPDATE 1 I tried all the combinations even one like this val q = for{ Join(p,sv) <- Parameters leftJoin SensorValues on (_.id is sv.parameter_id) r <- Readings if sv.reading_id is r.id } yield(r,p,sv) In this case

Play Framework 2.3 how to reset database?

会有一股神秘感。 提交于 2020-01-14 09:07:07
问题 In the Play 2.3.x documentation on Evolutions it says In development mode however it is often simpler to simply trash your development database and reapply all evolutions from the beginning. However it doesn't give instructions on how to do this. Is there some kind of activator command I can use to do this? How can I reset and reapply evolutions? Thanks! Update: I would prefer not to have to mess with my DB manually, but it seems like that's the only way 回答1: If you don't care about the data