playframework-2.2

Using MockitoSugar of scalatestplus-play deprecated

元气小坏坏 提交于 2021-02-10 16:18:51
问题 I'm using "scalatestplus-play" % "5.1.0" , and I'm trying to bring MockitoSugar to my class like I did in earlier projects: class MyTestSpec extends AnyFreeSpec with MockitoSugar so I can use the mock[MyClass] function and now it docent exists, can't find in the documentation something else. in my earlier projects I used "scalatestplus-play" % "4.0.3" , I'm sure there is a different way now but can't find what it is 回答1: First option you have, is to use scalatestplus-mockito, where you can

hibernate @Entity on inner class only (top level class is not an @Entity)

夙愿已清 提交于 2021-02-07 18:47:54
问题 I would like to persist inner class into database. But it dosnt work. Is there possibilty to do that? Or should i put that inner class into new plain file? Now I am getting an error [IllegalArgumentException: Unknown entity: models.foo$bar] My class file: package models; public class foo { @Required public String report; @Required public String reportType; @Entity public static class bar{ @Required public int year; @Required public int month; public void toDataBase() { JPA.em().persist(this);

hibernate @Entity on inner class only (top level class is not an @Entity)

不打扰是莪最后的温柔 提交于 2021-02-07 18:46:56
问题 I would like to persist inner class into database. But it dosnt work. Is there possibilty to do that? Or should i put that inner class into new plain file? Now I am getting an error [IllegalArgumentException: Unknown entity: models.foo$bar] My class file: package models; public class foo { @Required public String report; @Required public String reportType; @Entity public static class bar{ @Required public int year; @Required public int month; public void toDataBase() { JPA.em().persist(this);

Forking tests fail because javaOptions seems to be misconfigured

£可爱£侵袭症+ 提交于 2020-02-07 03:45:31
问题 Using Play 2.X, I expect my tests to be forked by default (new way from Play 2.X) and especially well run. However, when using this SBT configuration in my Build.scala , I observe an OOM due to permgen space, like the following: Uncaught exception when running myspecs.AllSpecs: java.lang.OutOfMemoryError: PermGen space sbt.ForkMain$ForkError: PermGen space at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:791) at java.security

play framework Logging ebean SQL statments

可紊 提交于 2020-01-17 03:06:53
问题 I'm using play 2.2.0 How cam I log ebean sql I tried db.default.logStatements=true logger.com.jolbox=DEBUG In config file but no luck. should I add any code to my models or create extra config files? what Is the configuration working for this version? 回答1: Hi you need to add logger.xml to your /conf/logger.xml . <configuration> <timestamp key="bySecond" datePattern="yyyy_MM_dd_HH_mm"/> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%-5level - %msg%n<

Custom view directories for Play Framework 2.x not working

為{幸葍}努か 提交于 2020-01-16 23:15:28
问题 I'm new to using Play Framework (2.2.x) and I am having a tough time figuring out how to render views not located in the \app\views directory. My project is organized such that each section (directory) of the app has it's own views, controllers, services, repositories... etc. It's a structure I'd like to keep. It looks something like this: \app\Game\Views \app\Game\Controllers \app\Game\Services \app\Game\Repositories \app\Players\Views \app\Players\Controllers \app\Common\Views \app\Common

Custom view directories for Play Framework 2.x not working

跟風遠走 提交于 2020-01-16 23:12:08
问题 I'm new to using Play Framework (2.2.x) and I am having a tough time figuring out how to render views not located in the \app\views directory. My project is organized such that each section (directory) of the app has it's own views, controllers, services, repositories... etc. It's a structure I'd like to keep. It looks something like this: \app\Game\Views \app\Game\Controllers \app\Game\Services \app\Game\Repositories \app\Players\Views \app\Players\Controllers \app\Common\Views \app\Common

Play! Framework 2 REST Authentication and Authorization for Android Client

旧街凉风 提交于 2020-01-13 16:55:47
问题 I'm currently working on an application that has web version (Play! Framework 2.2.x) and Android Client. Due to the fact that Play! is fully RESTful I want to communicate between Play! and Android with JSON requests and responses. Web version of the application is using Play Authenticate plugin which supports authentication and authorization. I would like to know how to enable login in Android Client that would use Play! app and how to secure the communication between Play! app and Android

Cannot register class in Ebean server (Play Framework 2 - Java)

我的未来我决定 提交于 2020-01-13 09:03:28
问题 I am getting the following error when running my Play Framework 2.2.x (Java) project: Configuration error Cannot register class [models.SomeClass] in Ebean server The error messages displayed in the browser points me to the line ebean.default="models.*" in my application.conf , and the console tells me that I have a java.lang.VerifyError: Bad type on operand stack in one of my methods. There is nothing special about the methods for which this happens, and it has happened for a handfull of

sbt-proguard with play 2.2.3

随声附和 提交于 2020-01-12 18:53:31
问题 We developed a web application with play 2.2.3 and want to obfuscate it. I am trying to use sbt-proguard plugin. I put the line below to PROJECT_FOLDER/project/plugins.sbt file addSbtPlugin("com.typesafe.sbt" % "sbt-proguard" % "0.2.2") and put the lines below to PROJECT_FOLDER/build.sbt file proguardSettings ProguardKeys.options in Proguard ++= Seq("-dontnote", "-dontwarn", "-ignorewarnings") ProguardKeys.options in Proguard += ProguardOptions.keepMain("Application") inConfig(Proguard)