{"id":6232,"date":"2014-04-13T23:32:07","date_gmt":"2014-04-13T23:32:07","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/13\/problem-about-playframework-2-2-collection-of-common-programming-errors\/"},"modified":"2014-04-13T23:32:07","modified_gmt":"2014-04-13T23:32:07","slug":"problem-about-playframework-2-2-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/13\/problem-about-playframework-2-2-collection-of-common-programming-errors\/","title":{"rendered":"problem about playframework-2.2-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d7fb3970505d9f22496189667a0fefe8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1136342<br \/>\nunit-testing ssl junit ssl-certificate playframework-2.2<br \/>\nIs it possible to write a test with Play&#8217;s built-in testing for an SSL page? I use the example Integration test:import org.junit.*;import play.mvc.*; import play.test.*; import play.libs.F.*;import static play.test.Helpers.*; import static org.fest.assertions.Assertions.*;import static org.fluentlenium.core.filter.FilterConstructor.*;public class IntegrationTest {\/*** add your integration test here* in this example we just check if the welcome page is being shown*\/@Testpublic void test() {runnin<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/JwGIq.png?s=32&amp;g=1\" \/><br \/>\nChafik<br \/>\nmysql validation ebean playframework-2.2<br \/>\nI am developing an app with Play 2.2.0 and Ebean. I have a problem when creating directly entities by code, not using a form. Let&#8217;s say this is my entity :import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import javax.validation.constraints.NotNull;import models.SuperEntity;import com.avaje.ebean.validation.Length;@Entity @Table(name = &#8220;foos&#8221;) public class Foo extends SuperEntity {@Column(unique = true)@NotNull@Length(min = 2, max = 2)public String<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/413967f7ca823b214c0365aa0e4c2273?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nticofab<br \/>\nscala playframework akka actor playframework-2.2<br \/>\nThe context.parent reference does not do it, for me. In a Play project, I launch a new actor to deal with each incoming request:val myActor: ActorRef = system.actorOf(Props(classOf[MyActor])val future: Future[String] = (myActor ? Hello)(5.seconds).mapTo[String]future.map(result =&gt; Ok(result)).recover {case ex: AskTimeoutException =&gt; Ok(&#8220;timeout expired&#8221;)case _ =&gt; Ok(&#8220;error&#8221;) }This triggers more actor messaging in the receive method of myActor: when anotherActor responds to myActor, the<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/86637c99f25d60157aa0f2e7eab90148?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRobin Green<br \/>\njson scala generics playframework playframework-2.2<br \/>\nIs it possible to create a generic function in Scala, using Play Framework 2.2, that will serialize an arbitrary object to JSON, without having to be supplied a writer or formatter?For instance, this non-generic code will create a JSON response given a Customer:import play.api.libs.json._ import play.api.libs.functional.syntax._case class Customer(id: Int, name: String)object scratch {val p = Customer(1, &#8220;n&#8221;) \/\/&gt; p : Customer = Customer(1,n)def createJsonResponseCustom<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/133978b437b712189938510d2072a137?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nChris<br \/>\nplayframework newrelic playframework-2.2<br \/>\nWith previous version of the Java Play framework, we could provide a command line argent to load monitoring agents. For example, NewRelic could be loaded as.\/path\/to\/start -javaagent:\/path\/to\/newrelic.jarWith the release of the 2.2, the Play team has significantly changed the start script. From what I can tell, it no longer supports javaagents. Has any else gotten NewRelic running with Java Play 2.2+? Play is great, but its useless tech if you can&#8217;t monitor it in a production environment&#8230;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/66e73d7a4a273627561ac9db632c4bd2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPetro Verheles<br \/>\nheroku playframework-2.2<br \/>\nI&#8217;m trying to deploy java computer-database example from play 2.2.0 framework. The steps I do in the root of the project:git init git add . git commit -m &#8220;init&#8221; heroku create git push heroku masterAfter the step 5 the app is deployed to heroku and tries to start, but fails with unclear java.lang.NullPointerException. Here are the last few lines of build log:[SUCCESSFUL ] org.fusesource.jansi#jansi;1.4!jansi.jar (363ms):: retrieving :: org.scala-sbt#boot-scalaconfs: [default]5 artifacts copied, 0<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/y5IQ6.jpg?s=32&amp;g=1\" \/><br \/>\nCarla<br \/>\nscala heroku deployment scala-2.10 playframework-2.2<br \/>\nI&#8217;ve been fighting with this for hours and I can&#8217;t figure out why after deploying my Scala Play 2.2 application in Heroku I get this stacktrace:2013-09-30T01:05:09.413177+00:00 heroku[web.1]: Starting process with command `target\/start -Dhttp.port=18174 $PLAY_OPTS` 2013-09-30T01:05:10.931893+00:00 app[web.1]: bash: target\/start: No such file or directory 2013-09-30T01:05:12.382399+00:00 heroku[web.1]: Process exited with status 127 2013-09-30T01:05:12.414050+00:00 heroku[web.1]: State changed fr<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5b5168afa2a32be98d6e06c8612c0b96?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nuser2924344<br \/>\njavascript jquery requirejs playframework-2.2 webjars<br \/>\nAfter upgrade to play 2.2, I cannot make requirejs work as before.It seems to me that the requirejs is not initialized or configured correctly. I tried to follow https:\/\/github.com\/mariussoutier\/play-angular-require-seed, but I cannot even make the simplest case to work.jquery can be located correctly in main.js, but require([&#8216;jquery&#8217;]&#8230;..) does not work in tag.If someone could help me with this, it would be appreciated a lot.webjars definitionlibraryDependencies ++= Seq(javaJdbc,javaEbean,cac<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>user1136342 unit-testing ssl junit ssl-certificate playframework-2.2 Is it possible to write a test with Play&#8217;s built-in testing for an SSL page? I use the example Integration test:import org.junit.*;import play.mvc.*; import play.test.*; import play.libs.F.*;import static play.test.Helpers.*; import static org.fest.assertions.Assertions.*;import static org.fluentlenium.core.filter.FilterConstructor.*;public class IntegrationTest {\/*** add your integration test here* in this example we just check if [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6232","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6232"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6232\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}