Coder Social home page Coder Social logo

playframework / play-samples Goto Github PK

View Code? Open in Web Editor NEW
511.0 21.0 535.0 6.98 MB

Play Framework Sample Projects

License: Creative Commons Zero v1.0 Universal

Java 15.55% HTML 11.47% Scala 28.89% CSS 9.30% Shell 2.57% JavaScript 31.04% CoffeeScript 0.76% Less 0.41%
playframework example example-project sample sample-app jvm webapp

play-samples's Introduction

Play samples

Twitter Follow Discord GitHub Discussions StackOverflow YouTube Twitch Status OpenCollective

Build Status Repository size Scala Steward badge Mergify Status

License

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion by you shall be licensed as above, without any additional terms or conditions.

play-samples's People

Contributors

aaabramov avatar corruptmemory avatar dwijnand avatar ennru avatar gmethvin avatar havocp avatar henrikengstrom avatar ignasi35 avatar ihostage avatar jamesward avatar jsuereth avatar kipsigman avatar kristileka avatar ktoso avatar marcospereira avatar markusjura avatar max-ar avatar mergify[bot] avatar mkurz avatar octonato avatar peutit avatar pvlugter avatar raboof avatar retroryan avatar richdougherty avatar rstento avatar sachgar avatar scala-steward avatar sullis avatar wsargent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

play-samples's Issues

JavaEbean and evolutions

Though the JavaEbean examples does compile and run, if you add a value to a model, the app breaks because the evolution does not run and modify the database. This creates sql errors, cause the queries do not match the underlying database.

How can we get evolutions running with this example as it used to be with play 2.6?

java.lang.ClassNotFoundException xsbt.CompilerInterface while running play-scala-rest-api-example

Hi

This is i found while trying res-api example

sbt run
[info] welcome to sbt 1.3.13 (Oracle Corporation Java 1.8.0_151)
[info] loading settings for project global-plugins from idea.sbt ...
[info] loading global plugins from /home/henky/.sbt/1.0/plugins
[info] loading settings for project play-scala-rest-api-example-build from plugins.sbt ...
[info] loading project definition from /home/henky/scala/play-samples/play-scala-rest-api-example/project
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
..
..
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)
[error] (Compile / compileIncremental) java.lang.ClassNotFoundException: xsbt.CompilerInterface

My computer scala version = 2.13.5

The links redirecting to the play framework documentation are broken.

I'm discovering the play framework and while following the hello-world tutorial I encountered an issue.
In the play-samples templates, the links redirecting to the documentations are presented as follow:

<li><a href="https://playframework.com/documentation/@version" target="_blank">Play documentation</a></li>

The @version variable is 2.8.4.

It will produce the url https://www.playframework.com/documentation/2.8.4/Home redirecting to a page not found while the real documentation url would be https://www.playframework.com/documentation/2.8.x/Home.

It concerns the 3 branch 2.6.x, 2.7,x, 2.8.x in the following samples:

Create SECURITY.md

Hey there!

I belong to an open source security research community, and a member (@oivrip) has found an issue, but doesn’t know the best way to disclose it.

If not a hassle, might you kindly add a SECURITY.md file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.

Thank you for your consideration, and I look forward to hearing from you!

(cc @huntr-helper)

Format each sample project

We could add something like https://github.com/akka/akka-guide/blob/54a81ce729ef07e1f9b97f0f15a4ff7d60e4d0ed/scripts/format-all.sh and even remove the separate Travis jobs.
WDYT?

Code, click to exapnd
#!/usr/bin/env bash

declare -r tutorial_root="docs-source/docs/modules/microservices-tutorial/examples"

find ${tutorial_root} -name .scalafmt.conf |
while read result
do
	pushd $(dirname $result)
	sbt scalafmtAll
	popd
done

find ${tutorial_root} -name pom.xml |
while read result
do
	pushd $(dirname $result)
	mvn spotless:apply
	popd
done

Originally posted by @ennru in #116 (comment)

For the sample "play-samples-play-scala-rest-api-example": Got error when runing 'sbt gatling:test'

Trying to play with the sample app for Play 2.7 play-samples-play-scala-rest-api-example
Got the error as follow. It seems it tried to use the io.netty to do some ssl works, but it cannot find it.
Is it related that Play 2.6 switched to Akka HTTP now?

Can anyone let me know how to fix it? Gatling seems a good choice for loading test for web rest app.

[info] Loading global plugins from /Users/nyu/.sbt/1.0/plugins
[info] Loading settings for project model-service-build from plugins.sbt ...
[info] Loading project definition from /Users/nyu/Projects/model-service/project
[info] Loading settings for project root from build.sbt ...
[info] Loading settings for project docs from build.sbt ...
[info] Set current project to play-scala-rest-api-example (in build file:/Users/nyu/Projects/model-service/)
[info] Compiling 1 Scala source to /Users/nyu/Projects/model-service/target/scala-2.12/test-classes ...
[info] Done compiling.
[info] Compiling 1 Scala source to /Users/nyu/Projects/model-service/target/scala-2.12/gatling-classes ...
[info] Done compiling.
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=iso-8859-1
Warning: Unknown option -m
[error] i.g.a.Gatling$ - Run crashed
java.lang.NoSuchMethodError: io.netty.internal.tcnative.SSLContext.setUseTasks(JZ)V
	at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:347)
	at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:193)
	at io.netty.handler.ssl.OpenSslContext.<init>(OpenSslContext.java:34)
	at io.netty.handler.ssl.OpenSslClientContext.<init>(OpenSslClientContext.java:188)
	at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:777)
	at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:452)
	at io.gatling.http.util.SslContextsFactory.newSslContexts(SslContexts.scala:99)
	at io.gatling.http.engine.DefaultHttpClientFactory.newClientConfig(HttpClientFactory.scala:58)
	at io.gatling.http.engine.DefaultHttpClientFactory.newClient(HttpClientFactory.scala:77)
	at io.gatling.http.engine.HttpEngine$.apply(HttpEngine.scala:47)
[error] Uncaught exception when running simulation.GatlingSpec: java.lang.NoSuchMethodError: io.netty.internal.tcnative.SSLContext.setUseTasks(JZ)V
[error] sbt.ForkMain$ForkError: java.lang.NoSuchMethodError: io.netty.internal.tcnative.SSLContext.setUseTasks(JZ)V
[error] 	at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:347)
[error] 	at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:193)
[error] 	at io.netty.handler.ssl.OpenSslContext.<init>(OpenSslContext.java:34)
[error] 	at io.netty.handler.ssl.OpenSslClientContext.<init>(OpenSslClientContext.java:188)
[error] 	at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:777)
[error] 	at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:452)
[error] 	at io.gatling.http.util.SslContextsFactory.newSslContexts(SslContexts.scala:99)
[error] 	at io.gatling.http.engine.DefaultHttpClientFactory.newClientConfig(HttpClientFactory.scala:58)
[error] 	at io.gatling.http.engine.DefaultHttpClientFactory.newClient(HttpClientFactory.scala:77)
[error] 	at io.gatling.http.engine.HttpEngine$.apply(HttpEngine.scala:47)
[error] 	at io.gatling.http.protocol.HttpProtocol$$anon$1.newComponents(HttpProtocol.scala:54)
[error] 	at io.gatling.core.protocol.ProtocolComponentsRegistry.$anonfun$components$1(Protocol.scala:68)
[error] 	at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:86)
[error] 	at io.gatling.core.protocol.ProtocolComponentsRegistry.componentsFactory$1(Protocol.scala:68)
[error] 	at io.gatling.core.protocol.ProtocolComponentsRegistry.comps$1(Protocol.scala:70)
[error] 	at io.gatling.core.protocol.ProtocolComponentsRegistry.$anonfun$components$4(Protocol.scala:72)
[error] 	at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:86)
[error] 	at io.gatling.core.protocol.ProtocolComponentsRegistry.components(Protocol.scala:72)
[error] 	at io.gatling.http.action.HttpActionBuilder.lookUpHttpComponents(HttpActionBuilder.scala:26)
[error] 	at io.gatling.http.action.HttpRequestActionBuilder.build(HttpRequestActionBuilder.scala:33)
[error] 	at io.gatling.core.structure.StructureBuilder.$anonfun$build$1(StructureBuilder.scala:35)
[error] 	at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error] 	at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error] 	at scala.collection.immutable.List.foldLeft(List.scala:89)
[error] 	at io.gatling.core.structure.StructureBuilder.build(StructureBuilder.scala:34)
[error] 	at io.gatling.core.structure.StructureBuilder.build$(StructureBuilder.scala:33)
[error] 	at io.gatling.core.structure.ChainBuilder.build(ChainBuilder.scala:31)
[error] 	at io.gatling.core.action.builder.LoopBuilder.build(LoopBuilder.scala:61)
[error] 	at io.gatling.core.structure.StructureBuilder.$anonfun$build$1(StructureBuilder.scala:35)
[error] 	at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error] 	at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error] 	at scala.collection.immutable.List.foldLeft(List.scala:89)
[error] 	at io.gatling.core.structure.StructureBuilder.build(StructureBuilder.scala:34)
[error] 	at io.gatling.core.structure.StructureBuilder.build$(StructureBuilder.scala:33)
[error] 	at io.gatling.core.structure.ScenarioBuilder.build(ScenarioBuilder.scala:38)
[error] 	at io.gatling.core.structure.PopulationBuilder.build(ScenarioBuilder.scala:100)
[error] 	at io.gatling.core.scenario.SimulationParams.$anonfun$scenarios$1(Simulation.scala:194)
[error] 	at scala.collection.immutable.List.map(List.scala:286)
[error] 	at io.gatling.core.scenario.SimulationParams.scenarios(Simulation.scala:194)
[error] 	at io.gatling.app.Runner.run0(Runner.scala:92)
[error] 	at io.gatling.app.Runner.run(Runner.scala:61)
[error] 	at io.gatling.app.Gatling$.start(Gatling.scala:73)
[error] 	at io.gatling.app.Gatling$.fromArgs(Gatling.scala:46)
[error] 	at io.gatling.sbt.GatlingTask.liftedTree1$1(GatlingTask.scala:52)
[error] 	at io.gatling.sbt.GatlingTask.execute(GatlingTask.scala:51)
[error] 	at sbt.ForkMain$Run.lambda$runTest$1(ForkMain.java:304)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] 	at java.lang.Thread.run(Thread.java:745)
[info] Simulation(s) execution ended.
[error] Error during tests:
[error] 	simulation.GatlingSpec
[error] (Gatling / test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 8 s, completed Jun 4, 2019 4:10:12 PM
mac-nayu:model-service nyu$
mac-nayu:model-service nyu$ sbt gatling:test
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=iso-8859-1
[info] Loading global plugins from /Users/nyu/.sbt/1.0/plugins
[info] Loading settings for project model-service-build from plugins.sbt ...
[info] Loading project definition from /Users/nyu/Projects/model-service/project
[info] Loading settings for project root from build.sbt ...
[info] Loading settings for project docs from build.sbt ...
[info] Set current project to play-scala-rest-api-example (in build file:/Users/nyu/Projects/model-service/)
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=iso-8859-1
Warning: Unknown option -m
[error] i.g.a.Gatling$ - Run crashed
java.lang.NoSuchMethodError: io.netty.internal.tcnative.SSLContext.setUseTasks(JZ)V
	at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:347)
	at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:193)
	at io.netty.handler.ssl.OpenSslContext.<init>(OpenSslContext.java:34)
	at io.netty.handler.ssl.OpenSslClientContext.<init>(OpenSslClientContext.java:188)
	at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:777)
	at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:452)
	at io.gatling.http.util.SslContextsFactory.newSslContexts(SslContexts.scala:99)
	at io.gatling.http.engine.DefaultHttpClientFactory.newClientConfig(HttpClientFactory.scala:58)
	at io.gatling.http.engine.DefaultHttpClientFactory.newClient(HttpClientFactory.scala:77)
	at io.gatling.http.engine.HttpEngine$.apply(HttpEngine.scala:47)
[error] Uncaught exception when running simulation.GatlingSpec: java.lang.NoSuchMethodError: io.netty.internal.tcnative.SSLContext.setUseTasks(JZ)V
[error] sbt.ForkMain$ForkError: java.lang.NoSuchMethodError: io.netty.internal.tcnative.SSLContext.setUseTasks(JZ)V
[error] 	at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:347)
[error] 	at io.netty.handler.ssl.ReferenceCountedOpenSslContext.<init>(ReferenceCountedOpenSslContext.java:193)
[error] 	at io.netty.handler.ssl.OpenSslContext.<init>(OpenSslContext.java:34)
[error] 	at io.netty.handler.ssl.OpenSslClientContext.<init>(OpenSslClientContext.java:188)
[error] 	at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:777)
[error] 	at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:452)
[error] 	at io.gatling.http.util.SslContextsFactory.newSslContexts(SslContexts.scala:99)
[error] 	at io.gatling.http.engine.DefaultHttpClientFactory.newClientConfig(HttpClientFactory.scala:58)
[error] 	at io.gatling.http.engine.DefaultHttpClientFactory.newClient(HttpClientFactory.scala:77)
[error] 	at io.gatling.http.engine.HttpEngine$.apply(HttpEngine.scala:47)
[error] 	at io.gatling.http.protocol.HttpProtocol$$anon$1.newComponents(HttpProtocol.scala:54)
[error] 	at io.gatling.core.protocol.ProtocolComponentsRegistry.$anonfun$components$1(Protocol.scala:68)
[error] 	at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:86)
[error] 	at io.gatling.core.protocol.ProtocolComponentsRegistry.componentsFactory$1(Protocol.scala:68)
[error] 	at io.gatling.core.protocol.ProtocolComponentsRegistry.comps$1(Protocol.scala:70)
[error] 	at io.gatling.core.protocol.ProtocolComponentsRegistry.$anonfun$components$4(Protocol.scala:72)
[error] 	at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:86)
[error] 	at io.gatling.core.protocol.ProtocolComponentsRegistry.components(Protocol.scala:72)
[error] 	at io.gatling.http.action.HttpActionBuilder.lookUpHttpComponents(HttpActionBuilder.scala:26)
[error] 	at io.gatling.http.action.HttpRequestActionBuilder.build(HttpRequestActionBuilder.scala:33)
[error] 	at io.gatling.core.structure.StructureBuilder.$anonfun$build$1(StructureBuilder.scala:35)
[error] 	at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error] 	at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error] 	at scala.collection.immutable.List.foldLeft(List.scala:89)
[error] 	at io.gatling.core.structure.StructureBuilder.build(StructureBuilder.scala:34)
[error] 	at io.gatling.core.structure.StructureBuilder.build$(StructureBuilder.scala:33)
[error] 	at io.gatling.core.structure.ChainBuilder.build(ChainBuilder.scala:31)
[error] 	at io.gatling.core.action.builder.LoopBuilder.build(LoopBuilder.scala:61)
[error] 	at io.gatling.core.structure.StructureBuilder.$anonfun$build$1(StructureBuilder.scala:35)
[error] 	at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error] 	at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error] 	at scala.collection.immutable.List.foldLeft(List.scala:89)
[error] 	at io.gatling.core.structure.StructureBuilder.build(StructureBuilder.scala:34)
[error] 	at io.gatling.core.structure.StructureBuilder.build$(StructureBuilder.scala:33)
[error] 	at io.gatling.core.structure.ScenarioBuilder.build(ScenarioBuilder.scala:38)
[error] 	at io.gatling.core.structure.PopulationBuilder.build(ScenarioBuilder.scala:100)
[error] 	at io.gatling.core.scenario.SimulationParams.$anonfun$scenarios$1(Simulation.scala:194)
[error] 	at scala.collection.immutable.List.map(List.scala:286)
[error] 	at io.gatling.core.scenario.SimulationParams.scenarios(Simulation.scala:194)
[error] 	at io.gatling.app.Runner.run0(Runner.scala:92)
[error] 	at io.gatling.app.Runner.run(Runner.scala:61)
[error] 	at io.gatling.app.Gatling$.start(Gatling.scala:73)
[error] 	at io.gatling.app.Gatling$.fromArgs(Gatling.scala:46)
[error] 	at io.gatling.sbt.GatlingTask.liftedTree1$1(GatlingTask.scala:52)
[error] 	at io.gatling.sbt.GatlingTask.execute(GatlingTask.scala:51)
[error] 	at sbt.ForkMain$Run.lambda$runTest$1(ForkMain.java:304)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)```
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] 	at java.lang.Thread.run(Thread.java:745)
[info] Simulation(s) execution ended.
[error] Error during tests:
[error] 	simulation.GatlingSpec
[error] (Gatling / test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 4 s, completed Jun 4, 2019 8:08:14 PM

play-scala-grpc-example : Define multiple services in a profo file and generate code with errors

Tried to write the same file twice.

[error] java.lang.RuntimeException: protoc returned exit code: 1
[error]         at scala.sys.package$.error(package.scala:30)
[error]         at sbtprotoc.ProtocPlugin$.compile(ProtocPlugin.scala:343)
[error]         at sbtprotoc.ProtocPlugin$.compileProto$1(ProtocPlugin.scala:431)
[error]         at sbtprotoc.ProtocPlugin$.$anonfun$sourceGeneratorTask$10(ProtocPlugin.scala:438)
[error]         at sbt.util.FileFunction$.$anonfun$cached$1(FileFunction.scala:80)
[error]         at sbt.util.FileFunction$.$anonfun$cached$4(FileFunction.scala:153)
[error]         at sbt.util.Difference.apply(Tracked.scala:414)
[error]         at sbt.util.Difference.apply(Tracked.scala:394)
[error]         at sbt.util.FileFunction$.$anonfun$cached$3(FileFunction.scala:149)
[error]         at sbt.util.Difference.apply(Tracked.scala:414)
[error]         at sbt.util.Difference.apply(Tracked.scala:389)
[error]         at sbt.util.FileFunction$.$anonfun$cached$2(FileFunction.scala:148)
[error]         at sbtprotoc.ProtocPlugin$.$anonfun$sourceGeneratorTask$4(ProtocPlugin.scala:443)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]         at sbt.Execute.work(Execute.scala:291)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error]         at java.base/java.lang.Thread.run(Thread.java:829)
[error] (proto / Compile / protocGenerate) protoc returned exit code: 1

Java Ebean example is broken with modern JDK

Looks like Ebean example doesn't enhance classes since JDK 11 (OpenJDK) but works fine with 10. When I run play-java-ebean-example 2.6 or 2.7 I get following errors:


CreationException: Unable to create injector, see the following errors:

1) Error injecting constructor, io.ebean.config.BeanNotEnhancedException: Bean class models.Company is not enhanced? Check packages specified in ebean.mf. If you are running in IDEA or Eclipse check that the enhancement plugin is installed. See https://ebean.io/docs/trouble-shooting#not-enhanced
  at play.db.ebean.EbeanDynamicEvolutions.<init>(EbeanDynamicEvolutions.java:35)
  at play.db.ebean.EbeanDynamicEvolutions.class(EbeanDynamicEvolutions.java:32)
  while locating play.db.ebean.EbeanDynamicEvolutions
  at play.db.ebean.EbeanModule.bindings(EbeanModule.java:21):
Binding(class play.api.db.evolutions.DynamicEvolutions to ConstructionTarget(class play.db.ebean.EbeanDynamicEvolutions) eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$4)
  while locating play.api.db.evolutions.DynamicEvolutions
Caused by: io.ebean.config.BeanNotEnhancedException: Bean class models.Company is not enhanced? Check packages specified in ebean.mf. If you are running in IDEA or Eclipse check that the enhancement plugin is installed. See https://ebean.io/docs/trouble-shooting#not-enhanced
	at io.ebeaninternal.server.deploy.BeanDescriptorManager.setEntityBeanClass(BeanDescriptorManager.java:1575)
	at io.ebeaninternal.server.deploy.BeanDescriptorManager.createByteCode(BeanDescriptorManager.java:1440)
	at io.ebeaninternal.server.deploy.BeanDescriptorManager.readDeployAssociations(BeanDescriptorManager.java:1349)
	at io.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityDeploymentAssociations(BeanDescriptorManager.java:764)
	at io.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDescriptorManager.java:374)
        ...

I use OpenJDK.

play-rest-java-sample 504 when call put api

This how you can reproduce this issue.

  • download the sample
  • compile and run the project
  • call the post and get api
  • now call the put api to modify the data
  • it will throw 504 error.
private Optional<PostData> modify(EntityManager em, Long id, PostData postData) throws InterruptedException {
        final PostData data = em.find(PostData.class, id);
        if (data != null) {
            data.title = postData.title;
            data.body = postData.body;
        }
        Thread.sleep(10000L);
        return Optional.ofNullable(data);
    }

I figure out that if I remove the Thread.sleep it just work fine.

But why it's not working the Thread.sleep?

[play-samples-play-scala-hello-world-tutorial] Some unresolved dependencies have extra attributes.

I used dockerfile below to build play-samples-play-scala-hello-world-tutorial

FROM openjdk:11

ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV HULU_ENV=staging

ADD . /play-samples-play-scala-hello-world-tutorial
WORKDIR /play-samples-play-scala-hello-world-tutorial
RUN curl -L https://github.com/sbt/sbt/releases/download/v1.5.2/sbt-1.5.2.tgz -o sbt.tgz
RUN tar xf sbt.tgz

RUN ./sbt/bin/sbt clean stage

but got error below and failed to build

docker build . -f Dockerfile

#11 0.595 copying runtime jar...                                                                                             
#11 7.202 [info] [launcher] getting org.scala-sbt sbt 1.7.2  (this may take some time)...                                    
#11 37.07 [info] [launcher] getting Scala 2.12.16 (for sbt)...                                                               
#11 40.32 [info] welcome to sbt 1.7.2 (Oracle Corporation Java 11.0.16)                                                      
#11 42.57 [info] loading settings for project serengeti-build from plugins.sbt,scaffold.sbt ...
#11 43.22 [info] loading project definition from /serengeti/project
#11 69.16 [warn] 
#11 69.16 [warn] 	Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
#11 69.16 [warn] 		com.typesafe.sbt:sbt-js-engine:1.2.3 (scalaVersion=2.12, sbtVersion=1.0)
#11 69.16 [warn] 		org.foundweekends.giter8:sbt-giter8-scaffold:0.11.0 (sbtVersion=1.0, scalaVersion=2.12)
#11 69.16 [warn] 		com.typesafe.sbt:sbt-native-packager:1.5.2 (scalaVersion=2.12, sbtVersion=1.0)
#11 69.16 [warn] 		com.lightbend.sbt:sbt-javaagent:0.1.5 (scalaVersion=2.12, sbtVersion=1.0)
#11 69.16 [warn] 		com.typesafe.sbt:sbt-twirl:1.5.1 (scalaVersion=2.12, sbtVersion=1.0)
#11 69.16 [warn] 		com.typesafe.sbt:sbt-web:1.4.4 (scalaVersion=2.12, sbtVersion=1.0)
#11 69.16 [warn] 
#11 69.16 [warn] 	Note: Unresolved dependencies path:
#11 69.25 [error] sbt.librarymanagement.ResolveException: Error downloading com.typesafe.sbt:sbt-js-engine;sbtVersion=1.0;scalaVersion=2.12:1.2.3
#11 69.25 [error]   Not found
#11 69.25 [error]   Not found
#11 69.25 [error]   not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-js-engine_2.12_1.0/1.2.3/sbt-js-engine-1.2.3.pom
#11 69.25 [error]   not found: /root/.ivy2/localcom.typesafe.sbt/sbt-js-engine/scala_2.12/sbt_1.0/1.2.3/ivys/ivy.xml
#11 69.25 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-js-engine/scala_2.12/sbt_1.0/1.2.3/ivys/ivy.xml
#11 69.25 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-js-engine/scala_2.12/sbt_1.0/1.2.3/ivys/ivy.xml
#11 69.25 [error] Error downloading org.foundweekends.giter8:sbt-giter8-scaffold;sbtVersion=1.0;scalaVersion=2.12:0.11.0
#11 69.25 [error]   Not found
#11 69.25 [error]   Not found
#11 69.25 [error]   not found: https://repo1.maven.org/maven2/org/foundweekends/giter8/sbt-giter8-scaffold_2.12_1.0/0.11.0/sbt-giter8-scaffold-0.11.0.pom
#11 69.25 [error]   not found: /root/.ivy2/localorg.foundweekends.giter8/sbt-giter8-scaffold/scala_2.12/sbt_1.0/0.11.0/ivys/ivy.xml
#11 69.25 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.foundweekends.giter8/sbt-giter8-scaffold/scala_2.12/sbt_1.0/0.11.0/ivys/ivy.xml
#11 69.25 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.typesafe.com/typesafe/ivy-releases/org.foundweekends.giter8/sbt-giter8-scaffold/scala_2.12/sbt_1.0/0.11.0/ivys/ivy.xml
#11 69.25 [error] Error downloading com.typesafe.sbt:sbt-native-packager;sbtVersion=1.0;scalaVersion=2.12:1.5.2
#11 69.25 [error]   Not found
#11 69.25 [error]   Not found
#11 69.25 [error]   not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-native-packager_2.12_1.0/1.5.2/sbt-native-packager-1.5.2.pom
#11 69.25 [error]   not found: /root/.ivy2/localcom.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.5.2/ivys/ivy.xml
#11 69.25 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.5.2/ivys/ivy.xml
#11 69.25 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.5.2/ivys/ivy.xml
#11 69.25 [error] Error downloading com.lightbend.sbt:sbt-javaagent;sbtVersion=1.0;scalaVersion=2.12:0.1.5
#11 69.25 [error]   Not found
#11 69.25 [error]   Not found
#11 69.25 [error]   not found: https://repo1.maven.org/maven2/com/lightbend/sbt/sbt-javaagent_2.12_1.0/0.1.5/sbt-javaagent-0.1.5.pom
#11 69.25 [error]   not found: /root/.ivy2/localcom.lightbend.sbt/sbt-javaagent/scala_2.12/sbt_1.0/0.1.5/ivys/ivy.xml
#11 69.25 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.lightbend.sbt/sbt-javaagent/scala_2.12/sbt_1.0/0.1.5/ivys/ivy.xml
#11 69.25 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.lightbend.sbt/sbt-javaagent/scala_2.12/sbt_1.0/0.1.5/ivys/ivy.xml
#11 69.25 [error] Error downloading com.typesafe.sbt:sbt-twirl;sbtVersion=1.0;scalaVersion=2.12:1.5.1
#11 69.25 [error]   Not found
#11 69.26 [error]   Not found
#11 69.26 [error]   not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-twirl_2.12_1.0/1.5.1/sbt-twirl-1.5.1.pom
#11 69.26 [error]   not found: /root/.ivy2/localcom.typesafe.sbt/sbt-twirl/scala_2.12/sbt_1.0/1.5.1/ivys/ivy.xml
#11 69.26 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-twirl/scala_2.12/sbt_1.0/1.5.1/ivys/ivy.xml
#11 69.26 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-twirl/scala_2.12/sbt_1.0/1.5.1/ivys/ivy.xml
#11 69.26 [error] Error downloading com.typesafe.sbt:sbt-web;sbtVersion=1.0;scalaVersion=2.12:1.4.4
#11 69.26 [error]   Not found
#11 69.26 [error]   Not found
#11 69.26 [error]   not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-web_2.12_1.0/1.4.4/sbt-web-1.4.4.pom
#11 69.26 [error]   not found: /root/.ivy2/localcom.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/ivys/ivy.xml
#11 69.26 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/ivys/ivy.xml
#11 69.26 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/ivys/ivy.xml
#11 69.26 [error] 	at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:345)
#11 69.26 [error] 	at lmcoursier.CoursierDependencyResolution.$anonfun$update$38(CoursierDependencyResolution.scala:314)
#11 69.26 [error] 	at scala.util.Either$LeftProjection.map(Either.scala:573)
#11 69.26 [error] 	at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:314)
#11 69.26 [error] 	at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
#11 69.26 [error] 	at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:59)
#11 69.26 [error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:133)
#11 69.26 [error] 	at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:73)
#11 69.26 [error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:146)
#11 69.26 [error] 	at scala.util.control.Exception$Catch.apply(Exception.scala:228)
#11 69.26 [error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:146)
#11 69.26 [error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:127)
#11 69.26 [error] 	at sbt.util.Tracked$.$anonfun$inputChangedW$1(Tracked.scala:219)
#11 69.26 [error] 	at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:160)
#11 69.26 [error] 	at sbt.Classpaths$.$anonfun$updateTask0$1(Defaults.scala:3687)
#11 69.26 [error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
#11 69.26 [error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
#11 69.26 [error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:68)
#11 69.26 [error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
#11 69.26 [error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
#11 69.26 [error] 	at sbt.Execute.work(Execute.scala:291)
#11 69.26 [error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
#11 69.26 [error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
#11 69.26 [error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
#11 69.26 [error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
#11 69.26 [error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
#11 69.26 [error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
#11 69.26 [error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
#11 69.26 [error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
#11 69.26 [error] 	at java.base/java.lang.Thread.run(Thread.java:829)
#11 69.27 [error] (update) sbt.librarymanagement.ResolveException: Error downloading com.typesafe.sbt:sbt-js-engine;sbtVersion=1.0;scalaVersion=2.12:1.2.3
#11 69.27 [error]   Not found
#11 69.27 [error]   Not found
#11 69.27 [error]   not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-js-engine_2.12_1.0/1.2.3/sbt-js-engine-1.2.3.pom
#11 69.27 [error]   not found: /root/.ivy2/localcom.typesafe.sbt/sbt-js-engine/scala_2.12/sbt_1.0/1.2.3/ivys/ivy.xml
#11 69.27 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-js-engine/scala_2.12/sbt_1.0/1.2.3/ivys/ivy.xml
#11 69.27 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-js-engine/scala_2.12/sbt_1.0/1.2.3/ivys/ivy.xml
#11 69.27 [error] Error downloading org.foundweekends.giter8:sbt-giter8-scaffold;sbtVersion=1.0;scalaVersion=2.12:0.11.0
#11 69.27 [error]   Not found
#11 69.27 [error]   Not found
#11 69.28 [error]   not found: https://repo1.maven.org/maven2/org/foundweekends/giter8/sbt-giter8-scaffold_2.12_1.0/0.11.0/sbt-giter8-scaffold-0.11.0.pom
#11 69.28 [error]   not found: /root/.ivy2/localorg.foundweekends.giter8/sbt-giter8-scaffold/scala_2.12/sbt_1.0/0.11.0/ivys/ivy.xml
#11 69.28 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.foundweekends.giter8/sbt-giter8-scaffold/scala_2.12/sbt_1.0/0.11.0/ivys/ivy.xml
#11 69.28 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.typesafe.com/typesafe/ivy-releases/org.foundweekends.giter8/sbt-giter8-scaffold/scala_2.12/sbt_1.0/0.11.0/ivys/ivy.xml
#11 69.28 [error] Error downloading com.typesafe.sbt:sbt-native-packager;sbtVersion=1.0;scalaVersion=2.12:1.5.2
#11 69.28 [error]   Not found
#11 69.28 [error]   Not found
#11 69.28 [error]   not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-native-packager_2.12_1.0/1.5.2/sbt-native-packager-1.5.2.pom
#11 69.28 [error]   not found: /root/.ivy2/localcom.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.5.2/ivys/ivy.xml
#11 69.28 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.5.2/ivys/ivy.xml
#11 69.28 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-native-packager/scala_2.12/sbt_1.0/1.5.2/ivys/ivy.xml
#11 69.28 [error] Error downloading com.lightbend.sbt:sbt-javaagent;sbtVersion=1.0;scalaVersion=2.12:0.1.5
#11 69.28 [error]   Not found
#11 69.28 [error]   Not found
#11 69.28 [error]   not found: https://repo1.maven.org/maven2/com/lightbend/sbt/sbt-javaagent_2.12_1.0/0.1.5/sbt-javaagent-0.1.5.pom
#11 69.28 [error]   not found: /root/.ivy2/localcom.lightbend.sbt/sbt-javaagent/scala_2.12/sbt_1.0/0.1.5/ivys/ivy.xml
#11 69.28 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.lightbend.sbt/sbt-javaagent/scala_2.12/sbt_1.0/0.1.5/ivys/ivy.xml
#11 69.28 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.lightbend.sbt/sbt-javaagent/scala_2.12/sbt_1.0/0.1.5/ivys/ivy.xml
#11 69.28 [error] Error downloading com.typesafe.sbt:sbt-twirl;sbtVersion=1.0;scalaVersion=2.12:1.5.1
#11 69.28 [error]   Not found
#11 69.28 [error]   Not found
#11 69.28 [error]   not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-twirl_2.12_1.0/1.5.1/sbt-twirl-1.5.1.pom
#11 69.28 [error]   not found: /root/.ivy2/localcom.typesafe.sbt/sbt-twirl/scala_2.12/sbt_1.0/1.5.1/ivys/ivy.xml
#11 69.28 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-twirl/scala_2.12/sbt_1.0/1.5.1/ivys/ivy.xml
#11 69.28 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-twirl/scala_2.12/sbt_1.0/1.5.1/ivys/ivy.xml
#11 69.28 [error] Error downloading com.typesafe.sbt:sbt-web;sbtVersion=1.0;scalaVersion=2.12:1.4.4
#11 69.28 [error]   Not found
#11 69.28 [error]   Not found
#11 69.28 [error]   not found: https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-web_2.12_1.0/1.4.4/sbt-web-1.4.4.pom
#11 69.28 [error]   not found: /root/.ivy2/localcom.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/ivys/ivy.xml
#11 69.28 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/ivys/ivy.xml
#11 69.28 [error]   download error: Caught javax.net.ssl.SSLHandshakeException (Remote host terminated the handshake) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-web/scala_2.12/sbt_1.0/1.4.4/ivys/ivy.xml
#11 69.30 [warn] Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? (default: r)
------
executor failed running [/bin/sh -c ./sbt/bin/sbt clean stage]: exit code: 1

Any help is appreciated!

Fail to run 'sbt assembly' as in docs

Foolowing the play deploying section: https://www.playframework.com/documentation/2.8.x/Deploying the command 'sbt assembly' with the following errors:
[error] 1 error was encountered during merge
[error] java.lang.RuntimeException: deduplicate: different file contents found in the following:
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\joda\joda-convert\2.2.1\joda-convert-2.2.1.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\core\jackson-annotations\2.10.2\jackson-annotations-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\module\jackson-module-paranamer\2.10.2\jackson-module-paranamer-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\module\jackson-module-parameter-names\2.10.2\jackson-module-parameter-names-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.10.2\jackson-datatype-jdk8-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\core\jackson-databind\2.10.2\jackson-databind-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\dataformat\jackson-dataformat-cbor\2.10.2\jackson-dataformat-cbor-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.10.2\jackson-datatype-jsr310-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\jakarta\xml\bind\jakarta.xml.bind-api\2.3.2\jakarta.xml.bind-api-2.3.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\core\jackson-core\2.10.2\jackson-core-2.10.2.jar:module-info.class
[error] at sbtassembly.Assembly$.applyStrategies(Assembly.scala:141)
[error] at sbtassembly.Assembly$.x$1$lzycompute$1(Assembly.scala:25)
[error] at sbtassembly.Assembly$.x$1$1(Assembly.scala:23)
[error] at sbtassembly.Assembly$.stratMapping$lzycompute$1(Assembly.scala:23)
[error] at sbtassembly.Assembly$.stratMapping$1(Assembly.scala:23)
[error] at sbtassembly.Assembly$.inputs$lzycompute$1(Assembly.scala:67)
[error] at sbtassembly.Assembly$.inputs$1(Assembly.scala:57)
[error] at sbtassembly.Assembly$.apply(Assembly.scala:84)
[error] at sbtassembly.Assembly$.$anonfun$assemblyTask$1(Assembly.scala:249)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error] at sbt.Execute.work(Execute.scala:290)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (assembly) deduplicate: different file contents found in the following:
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\joda\joda-convert\2.2.1\joda-convert-2.2.1.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\core\jackson-annotations\2.10.2\jackson-annotations-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\module\jackson-module-paranamer\2.10.2\jackson-module-paranamer-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\module\jackson-module-parameter-names\2.10.2\jackson-module-parameter-names-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.10.2\jackson-datatype-jdk8-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\core\jackson-databind\2.10.2\jackson-databind-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\dataformat\jackson-dataformat-cbor\2.10.2\jackson-dataformat-cbor-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.10.2\jackson-datatype-jsr310-2.10.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\jakarta\xml\bind\jakarta.xml.bind-api\2.3.2\jakarta.xml.bind-api-2.3.2.jar:module-info.class
[error] C:\Users\arnold\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\fasterxml\jackson\core\jackson-core\2.10.2\jackson-core-2.10.2.jar:module-info.class
[error] Total time: 20 s, completed Apr 6, 2020 4:17:36 PM

Compilation Fails with cinnamon-chmetrics Not Found

I just checked out the latest copy of the 2.8.x branch and tried to run one of the provided samples, but it ran into an error:

[error]   not found: https://repo1.maven.org/maven2/com/lightbend/cinnamon/cinnamon-chmetrics/2.17.3/cinnamon-chmetrics-2.17.3.pom
[error] Error downloading com.lightbend.cinnamon:cinnamon-play_2.13:2.17.3
[error]   Not found
[error]   Not found
[error]   not found: /home/joesan/.ivy2/local/com.lightbend.cinnamon/cinnamon-play_2.13/2.17.3/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/com/lightbend/cinnamon/cinnamon-play_2.13/2.17.3/cinnamon-play_2.13-2.17.3.pom
[error] 	at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:345)
[error] 	at lmcoursier.CoursierDependencyResolution.$anonfun$update$38(CoursierDependencyResolution.scala:314)
[error] 	at scala.util.Either$LeftProjection.map(Either.scala:573)
[error] 	at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:314)
[error] 	at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error] 	at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:59)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:133)
[error] 	at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:73)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:146)
[error] 	at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:146)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:127)
[error] 	at sbt.util.Tracked$.$anonfun$inputChangedW$1(Tracked.scala:219)
[error] 	at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:160)
[error] 	at sbt.Classpaths$.$anonfun$updateTask0$1(Defaults.scala:3687)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] 	at sbt.Execute.work(Execute.scala:291)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] 	at java.base/java.lang.Thread.run(Thread.java:834)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.lightbend.cinnamon:cinnamon-chmetrics:2.17.3

Do I miss adding any resolvers? If so what is it?

play-java-dagger2-example inject JPAApi

I am exploring the play-java-dagger2-example project. I tried to get JPAApi instance from MyComponentsFromContext like this:

JPAApi jpaApi = application().injector().instanceOf(JPAApi.class);

But this throws [NoSuchMethodException: play.db.jpa.JPAApi.<init>()]
What is the correct way to get JPAApi with Dagger 2?

play-scala-hello-world-tutorial: compilation error with implicit value not found for assertsFinder

Hi, I am new to Scala / Play here. I am wondering if anyone could help me with the following issue I encountered when following along the hello world tutorial

Basically I am trying to add a new page. I followed the tutorial, added a new view, a new method in controller, and a new route. However, I am getting a compilation error showing:

play.sbt.PlayExceptions$CompilationException: Compilation error[could not find implicit value for parameter assetsFinder: controllers.AssetsFinder]
        at play.sbt.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:34)
        at play.sbt.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:34)
        at scala.Option.map(Option.scala:230)
        at play.sbt.run.PlayReload$.$anonfun$taskFailureHandler$8(PlayReload.scala:127)
        at scala.Option.map(Option.scala:230)
        at play.sbt.run.PlayReload$.taskFailureHandler(PlayReload.scala:100)
        at play.sbt.run.PlayReload$.compileFailure(PlayReload.scala:38)
        at play.sbt.run.PlayReload$.$anonfun$compile$3(PlayReload.scala:152)
        at scala.util.Either$LeftProjection.map(Either.scala:573)
        at play.sbt.run.PlayReload$.compile(PlayReload.scala:152)

[warn] Canceling execution...

Can someone help me figure out where went wrong please?

Code change:

https://github.com/coocooyao/play-samples/pull/1/files

Code fails to follow Scalas own reccomended Style guide.

Scala style is documented plainly.

https://docs.scala-lang.org/style/declarations.html
https://docs.scala-lang.org/style/indentation.html#line-wrapping

Yet this examples project fails to follow it for some reason.

class RequestHandler @Inject()(webCommands: WebCommands,
                               optDevContext: OptionalDevContext,
                               router: Router,
                               errorHandler: HttpErrorHandler,
                               configuration: HttpConfiguration,
                               filters: HttpFilters)
    extends DefaultHttpRequestHandler(webCommands,
                                      optDevContext,
                                      router,
                                      errorHandler,
                                      configuration,
                                      filters) { 
...

play-scala-tls certificates expired on 25th Aug 2019

$ cd play-samples/play-scala-tls-example/scripts
$ openssl x509 -in example.com.crt  -text 
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 63408077 (0x3c787cd)
    Signature Algorithm: ecdsa-with-SHA256
        Issuer: C=US, ST=California, L=San Francisco, O=Example Company, OU=Example Org, CN=exampleCA
        Validity
            Not Before: May 27 16:58:42 2019 GMT
            Not After : Aug 25 16:58:42 2019 GMT
        Subject: C=US, ST=California, L=San Francisco, O=Example Company, OU=Example Org, CN=example.com
        Subject Public Key Info:
            Public Key Algorithm: id-ecPublicKey
                Public-Key: (256 bit)
                pub: 
                    04:a8:b1:a8:15:bd:df:88:f4:71:cf:e9:18:f1:70:
                    a3:fa:23:a5:d2:92:f3:65:04:fc:24:b0:89:9a:7e:
                    57:74:09:8e:e9:6f:ee:e1:8d:1f:e0:94:40:74:6e:
...

This causes tests to fail:


[info] ServerSpec:
[info] Server
[info] - should work fine over https *** FAILED ***
[info]   The future returned an exception of type: java.net.ConnectException, with message: General SSLEngine problem. (ServerSpec.scala:40)
[info] ScalaTest
[info] Run completed in 5 seconds, 545 milliseconds.
[info] Total number of tests run: 1
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 0, failed 1, canceled 0, ignored 0, pending 0
[info] *** 1 TEST FAILED ***
[error] Failed: Total 1, Failed 1, Errors 0, Passed 0

This only surfaces now because we haven't launched a single build in the last 26+ days.

Play gRPC: ALPN must be enabled and list HTTP/2 as a supported protocol

I've tried to replicate the play-scala-grpc-example in my own Play project but it seems I cannot make this scala test pass, no matter what I do:

    "work with a gRPC client" in withGrpcClient[TenancyServiceClient] { client: TenancyServiceClient =>
      val tenantId  = UUID.randomUUID()
      val companyId = UUID.randomUUID()
      val reply =
        client.isCompanyIdOwnedByTenant(CheckCompanyRequest(tenantId.toString, companyId.toString)).futureValue
      reply.isOwnedByTenant mustBe false
    }

I've reported the details also in https://stackoverflow.com/q/77095588/1977778

I'm trying to enable ALPN and HTTP/2 in a Scala Play Framework 2.8.20 app running on JDK 11.0.20 and Scala 2.13.11 (SBT 1.9.3). My objective is to work with play-grpc and specifically to serve grpc calls using Play.

In project/plugins.sbt I added:

// Akka gRPC
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.1.6")
addSbtPlugin("com.github.sbt"    % "sbt-javaagent" % "0.1.7") // ALPN agent
// Cannot be moved into build.sbt
libraryDependencies += "com.lightbend.play" %% "play-grpc-generators" % "0.9.1"

In build.sbt:

lazy val `myProject` = (project in file("."))
  .enablePlugins(PlayScala)
  .enablePlugins(JavaAgent)
  .enablePlugins(AkkaGrpcPlugin)       // enables source generation for gRPC
  .enablePlugins(PlayAkkaHttp2Support) // enables serving HTTP/2 and gRPC
  .settings(
    akkaGrpcGeneratedLanguages := Seq(AkkaGrpc.Scala),
    akkaGrpcExtraGenerators += PlayScalaClientCodeGenerator,
    akkaGrpcExtraGenerators += PlayScalaServerCodeGenerator,
    // #grpc_server_generators
    PlayKeys.devSettings ++= Seq(
      "play.server.https.port" -> "9443",
      // Configures the keystore to use in Dev mode. This setting is equivalent to `play.server.https.keyStore.path`
      // in `application.conf`.
      "play.server.https.keyStore.path" -> "conf/selfsigned.keystore"
    )
  )

javaAgents += "org.mortbay.jetty.alpn" % "jetty-alpn-agent" % "2.0.10" % Runtime

When running tests I get:

[info] - must work with a gRPC client *** FAILED ***
[info]   java.lang.IllegalArgumentException: ALPN must be enabled and list HTTP/2 as a supported protocol.
[info]   at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
[info]   at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.ensureAlpnAndH2Enabled(GrpcSslContexts.java:278)
[info]   at io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder.sslContext(NettyChannelBuilder.java:350)
[info]   at akka.grpc.internal.NettyClientUtils$.createChannel(NettyClientUtils.scala:61)
[info]   at akka.grpc.internal.ChannelUtils$.create(ChannelUtils.scala:41)
[info]   at akka.grpc.GrpcChannel$.apply(GrpcChannel.scala:57)
[info]   at io.kode.protos.tenancy.TenancyServiceClient$.apply(TenancyServiceClient.scala:29)
[info]   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[info]   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[info]   at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

How should I fix this error??

ALPN must be enabled and list HTTP/2 as a supported protocol

ManyToMany Association + Repository

Hello,

Would you like please to show us how to add a ManyToMany association in Ebean 4.0.0 ++ with repository (Update / Delete) ?

This is an example of my model :


@Entity 
public class Sysuser extends BaseModel {
        
   @Constraints.Required
    public String username;
	
    @ManyToMany(cascade=CascadeType.ALL)
    public List<Role> roles;

Thank you in advance

Support Gradle

Examples

play-java-ebean-example - JSR-303 validated property 'name' does not have a corresponding accessor

Hello,

I'm completelly new to play, so I don't understand much of it yet. I wanted to try java+ebean example, but it didn't compile. Since the problem was connected to sbt-play-ebean plugin, I updated it to 6.2.0-RC4. Play version itself was already tha latest 2.8.13.

Then I needed to change deprecated version of EbeanServer to Database and Ebean to DB:
I changed this:

private final EbeanServer ebeanServer;
        
this.ebeanServer = Ebean.getServer(ebeanConfig.defaultServer());

to this:

private final Database ebeanServer;

this.ebeanServer = DB.getDefault();

Now the application runs, but when I want to change any entity in the database, it crashes with this error:

play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[IllegalStateException: JSR-303 validated property 'name' does not have a corresponding accessor for data binding - check your DataBinder's configuration (bean property versus direct field access)]]

I don't understand the databinder thing. It should work without getters/setters but it is not. List page is rendered well, the problem is in the edit page - none of the fields of the particular computer are prefilled, after saving it crashes.

Thank you for any help in advance!

Fix play-scala-tls-example on Java 11

Example failure: travis-ci.com/playframework/play-samples/jobs/198439885

play-scala-tls-example should be removed from being allowed to fail on Java 11. Also, its test should not be pending(!!), possibly need to rewrite it (it failed on Java 8 too - it's always been pending until fixed).

I upgraded play-ws to ssl-config's changes for Java 11 (playframework/play-ws#346) but ran into the issues above about the test being pending and not passing on Java 8.

scala-tls-example needClientAuth flag not considered

It seems that the current version of the sample does not consider the client certificate based authentication option set with play.ssl.needClientAuth=true .

Steps to reproduce:

  1. Git clone of the samples, change to the sample play-scala-tls-example
  2. Certificates have not been re-generated due to script errors, using the one from git
  3. Point example.com to localhost as described in the README
  4. Un-comment the line in ./play: JVM_OPTIONS="$JVM_OPTIONS -Dplay.ssl.needClientAuth=true"
  5. Adjust the javaagent line to avoid errors: from export SBT_OPTS="$SBT_OPTS -J-javaagent:$AGENT" to export SBT_OPTS="$SBT_OPTS -javaagent:$AGENT"
  6. run ./play run

Expected outcome: Opening the page https://example.com:9443/ should prompt for a certificate.

Actual outcome: The page https://example.com:9443/ opens without prompting for a client certificate. The console shows the following log output (folder names redacted):

Detected ALPN Agent: /.../play-samples/play-scala-tls-example/target/universal/stage/jetty-alpn-agent/jetty-alpn-agent-2.0.10.jar 
[jetty-alpn-agent][ warn] Could not find a matching alpn-boot jar for Java version: 11.0.14
[jetty-alpn-agent][ warn] Could not find a matching alpn-boot jar for Java version: 11.0.14
[info] welcome to sbt 1.3.13 (Eclipse Adoptium Java 11.0.14)
[info] loading global plugins from /.../.sbt/1.0/plugins
[info] loading settings for project play-scala-tls-example-build from plugins.sbt ...
[info] loading project definition from /.../play-samples/play-scala-tls-example/project
[info] loading settings for project root from build.sbt ...
[info]   __              __
[info]   \ \     ____   / /____ _ __  __
[info]    \ \   / __ \ / // __ `// / / /
[info]    / /  / /_/ // // /_/ // /_/ /
[info]   /_/  / .___//_/ \__,_/ \__, /
[info]       /_/               /____/
[info] 
[info] Version 2.8.13 running Java 11.0.14
[info] 
[info] Play is run entirely by the community. If you want to keep using it please consider donating:
[info] https://www.playframework.com/sponsors
[info] 

--- (Running the application, auto-reloading is enabled) ---

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/.../Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/google/inject/guice/4.2.3/guice-4.2.3.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[info] p.a.h.EnabledFilters - Enabled Filters (see <https://www.playframework.com/documentation/latest/Filters>):

    play.filters.csrf.CSRFFilter
    play.filters.headers.SecurityHeadersFilter
    play.filters.hosts.AllowedHostsFilter

[info] play.api.Play - Application started (Dev) (no global state)
[info] p.c.s.AkkaHttpServer - Enabling HTTP/2 on Akka HTTP server...
[info] p.c.s.AkkaHttpServer - Listening for HTTPS on /0:0:0:0:0:0:0:0:9443

(Server started, use Enter to stop and go back to the console...)

[debug] h.SniKeyManager - chooseEngineServerAlias: using selected sniHostname example.com as server alias

Environment:

  • Java java: 11.0.14-tem installed via sdkman (tried with 8.0.322 too)
  • OSX 12.2.1

play-scala-grpc-example run exception

Cloned the play-samples on my machine, and followed the documentation for locally running the play-scala-grpc-example sample app, but received an exception when invoking curl --insecure https://localhost:9443/

Here's the exception on the server:

! @7mf0gi45h - Internal server error, for (GET) [https://localhost:9443/] ->

play.api.UnexpectedException: Unexpected exception[StatusRuntimeException: UNAVAILABLE: io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]]
	at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:358)
	at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:264)
	at play.core.server.AkkaHttpServer$$anonfun$2.applyOrElse(AkkaHttpServer.scala:430)
	at play.core.server.AkkaHttpServer$$anonfun$2.applyOrElse(AkkaHttpServer.scala:422)
	at scala.concurrent.Future.$anonfun$recoverWith$1(Future.scala:417)
	at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
	at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:63)
	at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:100)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
	at io.grpc.Status.asRuntimeException(Status.java:533)
	at akka.grpc.internal.UnaryCallAdapter.onClose(UnaryCallAdapter.scala:40)
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:413)
	at io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:742)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:721)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
Caused by: javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem
	at io.grpc.netty.shaded.io.netty.handler.ssl.ReferenceCountedOpenSslEngine.handshakeException(ReferenceCountedOpenSslEngine.java:1771)
	at io.grpc.netty.shaded.io.netty.handler.ssl.ReferenceCountedOpenSslEngine.wrap(ReferenceCountedOpenSslEngine.java:776)
	at javax.net.ssl.SSLEngine.wrap(SSLEngine.java:511)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.wrap(SslHandler.java:1079)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.wrapNonAppData(SslHandler.java:970)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1443)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1275)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1322)
	at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
	at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:440)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:456)
	at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:323)
	at sun.security.validator.Validator.validate(Validator.java:271)
	at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:315)
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:278)
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:141)
	at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSslTlsv13X509ExtendedTrustManager.checkServerTrusted(OpenSslTlsv13X509ExtendedTrustManager.java:223)
	at io.grpc.netty.shaded.io.netty.handler.ssl.ReferenceCountedOpenSslClientContext$ExtendedTrustManagerVerifyCallback.verify(ReferenceCountedOpenSslClientContext.java:261)
	at io.grpc.netty.shaded.io.netty.handler.ssl.ReferenceCountedOpenSslContext$AbstractCertificateVerifier.verify(ReferenceCountedOpenSslContext.java:700)
	at io.grpc.netty.shaded.io.netty.internal.tcnative.SSL.readFromSSL(Native Method)
	Suppressed: javax.net.ssl.SSLHandshakeException: error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
		at io.grpc.netty.shaded.io.netty.handler.ssl.ReferenceCountedOpenSslEngine.sslReadErrorResult(ReferenceCountedOpenSslEngine.java:1287)
		at io.grpc.netty.shaded.io.netty.handler.ssl.ReferenceCountedOpenSslEngine.unwrap(ReferenceCountedOpenSslEngine.java:1248)
		at io.grpc.netty.shaded.io.netty.handler.ssl.ReferenceCountedOpenSslEngine.unwrap(ReferenceCountedOpenSslEngine.java:1324)
		at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler$SslEngineType$1.unwrap(SslHandler.java:201)
		at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1380)
		at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1275)
		at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1322)
		at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
		at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:440)
		at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
	at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
	at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:451)
	at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:323)
	at sun.security.validator.Validator.validate(Validator.java:271)
	at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:315)
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:278)
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:141)
	at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSslTlsv13X509ExtendedTrustManager.checkServerTrusted(OpenSslTlsv13X509ExtendedTrustManager.java:223)

Using following java version on OSX 11.6.2:

openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-bre_2021_10_20_23_15-b00)
OpenJDK 64-Bit Server VM (build 25.312-b00, mixed mode)

Remove references to Lightbend where possible

grep:

play-java-hello-world-tutorial/app/views/tutorial.scala.html:        <li><a href="https://developer.lightbend.com/start/?group=play" target="_blank">Play Example Apps</a>,
play-java-hello-world-tutorial/app/views/tutorial.scala.html:        <li>Podcast: <a href="https://www.lightbend.com/blog/why-is-play-framework-so-fast"
play-java-hello-world-tutorial/README.md:* sbt 1.9.6 or higher. Note: if you downloaded this project as a zip file from https://developer.lightbend.com, the file includes an sbt distribution for your convenience.
play-scala-hello-world-tutorial/app/views/tutorial.scala.html:        <li><a href="https://developer.lightbend.com/start/?group=play" target="_blank">Play Example Apps</a>,
play-scala-hello-world-tutorial/app/views/tutorial.scala.html:        <li>Podcast: <a href="https://www.lightbend.com/blog/why-is-play-framework-so-fast"
play-scala-hello-world-tutorial/README.md:* sbt 1.9.6 or higher. Note: if you downloaded this project as a zip file from https://developer.lightbend.com, the file includes an sbt distribution for your convenience.
play-java-grpc-example/build.sbt:  "com.lightbend.play"      %% "play-grpc-runtime"    % BuildInfo.playGrpcVersion,
play-java-grpc-example/build.sbt:  "com.lightbend.play" %% "play-grpc-testkit" % BuildInfo.playGrpcVersion % Test
play-java-grpc-example/README.md:This example is described in the [Play Java gRPC Example site](https://developer.lightbend.com/guides/play-java-grpc-example/).
play-java-grpc-example/README.md:For detailed documentation refer to https://www.playframework.com/documentation/latest/Home and https://developer.lightbend.com/docs/akka-grpc/current/ .
play-java-grpc-example/docs/src/main/paradox/index.md:[Akka gRPC](https://developer.lightbend.com/docs/akka-grpc/current/overview.html) is a toolkit for building streaming
play-java-grpc-example/docs/src/main/paradox/index.md:For detailed documentation refer to https://www.playframework.com/documentation/latest/Home and https://developer.lightbend.com/docs/akka-grpc/current/.
play-java-grpc-example/docs/src/main/paradox/index.md:kickstart your Play gRPC project on [Lightbend's Tech Hub](https://developer.lightbend.com/start/?group=play&project=play-java-grpc-example).
play-java-grpc-example/docs/src/main/paradox/code-details.md:You can read more about [Service gRPC from a Play App](https://developer.lightbend.com/docs/play-grpc/current/play/serving-grpc.html) in the docs.
play-java-grpc-example/docs/src/main/paradox/code-details.md:[using Pekko Discovery for endpoint discovery](https://developer.lightbend.com/docs/akka-grpc/current/client/configuration.html#using-akka-discovery-for-endpoint-discovery) for more details.
play-java-grpc-example/project/plugins.sbt:addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.10.5")
play-java-grpc-example/project/plugins.sbt:addSbtPlugin("com.lightbend.akka.grpc" %% "sbt-akka-grpc" % "1.0.2")
play-java-grpc-example/project/plugins.sbt:libraryDependencies += "com.lightbend.play" %% "play-grpc-generators" % playGrpcV
play-java-grpc-example/conf/application.conf:## overrides (https://github.com/lightbend/config#optional-system-or-env-variable-overrides)
play-scala-grpc-example/build.sbt:  "com.lightbend.play"      %% "play-grpc-runtime"    % BuildInfo.playGrpcVersion,
play-scala-grpc-example/build.sbt:  "com.lightbend.play"      %% "play-grpc-scalatest" % BuildInfo.playGrpcVersion % Test, 
play-scala-grpc-example/build.sbt:  "com.lightbend.play"      %% "play-grpc-specs2"    % BuildInfo.playGrpcVersion % Test, 
play-scala-grpc-example/README.md:This example is described in the [Play Scala gRPC Example site](https://developer.lightbend.com/guides/play-scala-grpc-example/).
play-scala-grpc-example/README.md:For detailed documentation refer to https://www.playframework.com/documentation/latest/Home and https://developer.lightbend.com/docs/akka-grpc/current/ .
play-scala-grpc-example/docs/src/main/paradox/index.md:[Akka gRPC](https://developer.lightbend.com/docs/akka-grpc/current/overview.html) is a toolkit for building streaming
play-scala-grpc-example/docs/src/main/paradox/index.md:For detailed documentation refer to https://www.playframework.com/documentation/latest/Home and https://developer.lightbend.com/docs/akka-grpc/current/.
play-scala-grpc-example/docs/src/main/paradox/index.md:kickstart your Play gRPC project on [Lightbend's Tech Hub](https://developer.lightbend.com/start/?group=play&project=play-scala-grpc-example).
play-scala-grpc-example/docs/src/main/paradox/code-details.md:You can read more about [Service gRPC from a Play App](https://developer.lightbend.com/docs/play-grpc/current/play/serving-grpc.html) in the docs.
play-scala-grpc-example/docs/src/main/paradox/code-details.md:[using Pekko Discovery for endpoint discovery](https://developer.lightbend.com/docs/akka-grpc/current/client/configuration.html#using-akka-discovery-for-endpoint-discovery) for more details.
play-scala-grpc-example/project/plugins.sbt:addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.10.5")
play-scala-grpc-example/project/plugins.sbt:addSbtPlugin("com.lightbend.akka.grpc" %% "sbt-akka-grpc" % "1.0.2")
play-scala-grpc-example/project/plugins.sbt:libraryDependencies += "com.lightbend.play" %% "play-grpc-generators" % playGrpcV
play-scala-grpc-example/conf/application.conf:## overrides (https://github.com/lightbend/config#optional-system-or-env-variable-overrides)
play-scala-rest-api-example/build.sbt:    paradoxProperties += ("download_url" -> "https://example.lightbend.com/v1/download/play-samples-play-scala-rest-api-example")
play-scala-rest-api-example/README.md:This is the example project for [Making a REST API in Play](http://developer.lightbend.com/guides/play-rest-api/index.html).
play-scala-rest-api-example/docs/src/main/paradox/index.md:## From Lightbend Tech Hub
play-scala-rest-api-example/docs/src/main/paradox/index.md:Download a pre-packaged bundle with this link: <https://example.lightbend.com/v1/download/play-samples-play-scala-rest-api-example>.
play-scala-rest-api-example/docs/src/main/paradox/index.md:The fun answer is that [Play is **fast**](https://www.lightbend.com/blog/why-is-play-framework-so-fast).
play-scala-rest-api-example/docs/src/main/paradox/index.md:In fact, Play is so fast that you have to turn off machines so that the rest of your architecture can keep up.  The Hootsuite team was able to **reduce the number of servers by 80%** by [switching to Play](https://www.lightbend.com/resources/case-studies-and-stories/how-hootsuite-modernized-its-url-shortener).  if you deploy Play with the same infrastructure that you were using for other web frameworks, you are effectively staging a denial of service attack against your own database.
play-scala-rest-api-example/docs/src/main/paradox/index.md:Play provides an easy to use MVC paradigm, including hot-reloading without any JVM bytecode magic or container overhead.  Startup time for a developer on Play was **reduced by roughly 7 times** for [Walmart Canada](https://www.lightbend.com/resources/case-studies-and-stories/walmart-boosts-conversions-by-20-with-lightbend-reactive-platform), and using Play **reduced development times by 2x to 3x**.
play-scala-rest-api-example/project/plugins.sbt:addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.10.5")

Suggestion to create an example for a token-base Endpoint Authentication (e.g. JWT)

Hello :)

I would suggest to create an example on how to secure a REST Endpoint via JSON Web Token.

The main reasons in my opinion are as followed:

  1. Many developers like to use the play framework for creating REST APIs. Since JWT Auth is the defacto standard for auth in the context of REST apis i would argue it would be useful to have this example.
  2. All "non official" sources regarding this topic are mostly outdated.
  3. It's hard for newcomers to solve such issues without some guidance.

I hope you can understand my suggestion and might consider it. Iam also open for other resources regarding this topic.

Regards

Moritz :)

Exception when executing play-scala-secure-session-example

I received an exception while trying to execute the project.

....
[error] (Compile / compileIncremental) java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI
[error] a.a.ActorSystemImpl - Internal server error, sending 500 response
akka.http.impl.util.One2OneBidiFlow$OutputTruncationException: Inner flow was completed without producing result elements for 1 outstanding elements
	at akka.http.impl.util.One2OneBidiFlow$OutputTruncationException$.apply(One2OneBidiFlow.scala:22)
	at akka.http.impl.util.One2OneBidiFlow$OutputTruncationException$.apply(One2OneBidiFlow.scala:22)
	at akka.http.impl.util.One2OneBidiFlow$One2OneBidi$$anon$1$$anon$4.onUpstreamFinish(One2OneBidiFlow.scala:97)
	at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:506)
	at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:376)
	at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:606)
	at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:485)
	at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:581)
	at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:749)
	at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:764)

Environment
SBT version: 1.3.2
JAVAC: 13 (Oracle)
JAVA: 13+13
play-samples branch: 2.7.x
libsodium: 1.0.18

Use Play's WebSocketClient in samples

There are 4 different variants of WebSocket.java in variosu samples on play-samples:

MD5 (play-java-chatroom-example/test/controllers/WebSocketClient.java) = dd467ea512ecd3b5e4075a456cec6ec4
MD5 (play-java-websocket-example/test/controllers/WebSocketClient.java) = 4eabd6c7627da67173ecd32713b8547c
MD5 (play-scala-chatroom-example/test/controllers/WebSocketClient.java) = dd3b5b4c72dcaaed02e32d287aca6708
MD5 (play-scala-websocket-example/test/controllers/WebSocketClient.java) = ce5101be52df25961bc51ace1a213c96

Despite being different, it's very likely they can be merged and even promoted to Play's testkit tools.

Converge tutorials (eliminate duplication)

We have multiple copies of tutorial/starter content. Some of that content is in the the play-xxx-start-example some of the content is in https://www.playframework.com/documentation/2.8.x/HelloWorldTutorial (backed by https://github.com/playframework/playframework/blob/master/documentation/manual/tutorial/HelloWorldTutorial.md).

Each writeup includes snippets maintained on each of the repos. The snippets not only are duplicate across repos, but the twirl templates are also duplicate between the play-xxx-start-example samples.

The welcome.scala.html templates also include introductions/tutorial contents and even copy/pasted snippets from the HomeController and the main.scala.html.

Summing up, as an example, a change in main.scala.html requires sync'ing code in 5 places:

  • 2x twirl templates on each of the samples
  • 2x welcome pages on each of the samples
  • 1x on the snippets of the documentation backing playframework.com's tutorial

Bump travis' scala version to 2.13.3

The travis build currently uses 2.13.1 and is injected into each job via usage of $TRAVIS_SCALA_VERSION in each project's scripts/test-sbt script.

A quick test to migrate to 2.13.3 compined with -Xfatal-warnings caused multiple jobs to fail.

Error in browser console for play-scala-macwire-di-example

When accessing localhost:9000 after sbt run, the following error log is displayed in the console :

  • firefox: Content Security Policy: The page’s settings blocked the loading of a resource at http://localhost:9000/favicon.ico (“default-src”).
  • brave: GET http://localhost:9000/favicon.ico 404 (Not Found)

While minor, it would be nice not to have error in the browser.

[Question] Scala secure session, is this a must?

Hi! I have a couple of apps running in production with Play! and I use simple cookie based authentication where I just store the username in the session and check for it in Authenticated Actions.
Very similar to how this example does it: https://alvinalexander.com/scala/how-to-implement-user-authentication-play-framework-application

Then I've noticed the play-scala-secure-session-example and got a little scared.

Is the way I'm using auth viable for production or should I try to encrypt the session ASAP?

Functional Test Failed

After downloading the source play-java-grpc-example, the application compiles and would run as expected.

When running the HelloFunctionalTest, in the sample application play-java-grpc-example we get the following error. Any pointers?

java.lang.IllegalArgumentException: gRPC client can't automatically find HTTP/2 connection: no valid endpoints available. ServerEndpoints(List(ServerEndpoint(Netty HTTP/1.1 (plaintext),http,localhost,45727,Set(1.0, 1.1),Some(netty),None), ServerEndpoint(Netty HTTP/1.1 (encrypted),https,localhost,33173,Set(1.0, 1.1),Some(netty),Some(ClientSsl(javax.net.ssl.SSLContext@6d0be7ab,sun.security.ssl.X509TrustManagerImpl@1d4fb213)))))

Not able to build the play-scala-websocket example

play-scala-websocket-example git:(2.7.x) ./gradlew clean build

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'play-scala-websocket-example'.
> Exception thrown while executing model rule: PlayApplicationPlugin.Rules#createBinaries(ModelMap<PlayApplicationBinarySpec>, PlayApplicationSpecInternal, PlatformResolvers, PlayToolChainInternal, PlayPluginConfigurations, File, ProjectIdentifier) > create(binary)
   > Not a supported Play version: 2.7.0. This plugin is compatible with: [PLAY_2_2_X, PLAY_2_3_X, PLAY_2_4_X, PLAY_2_5_X, PLAY_2_6_X].

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.