Code Monkey home page Code Monkey logo

play-scala-streaming-example's Introduction

play-scala-streaming-example's People

Contributors

dwijnand avatar gmethvin avatar marcelocenerine avatar marcospereira avatar octonato avatar richdougherty 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

Watchers

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

play-scala-streaming-example's Issues

Could you add a SSE example that uses `Source.actorRef` ?

I'm experimenting with Server Sent Events, and while the existing streamClock() example is nice, I've failed in adapting it to my purpose. I'd like:

  • a 'writable' Source[String, _] that I can push data into arbitrarily at a later date. Is that what Source.actorRef() is for?
  • a Publisher for which fanout is true (ie Sink.asPublisher(fanout = true)), so that multiple clients can all receive the resulting server-sent events.

I hope those are reasonable things to want, and that server-sent events are a reasonable way to achieve it. You can imagine a site with a big red button, and another 'viewer' page which many people could view - when the button is pressed, all users should see that event relayed on the 'viewer' page, simultaneously.

Here's the kind of code I've been trying:

  val (actorRef, publisher) =
    Source.actorRef[String](1000, OverflowStrategy.dropHead).toMat(Sink.asPublisher(fanout = true))(Keep.both).run()

  val sourceFromPublisher = Source.fromPublisher(publisher).log("actorPublisher")

  def streamClock() = Action {
    Ok.chunked(sourceFromPublisher via EventSource.flow).as(ContentTypes.EVENT_STREAM)
  }

(see rtyley@77572a8#diff-0558d2a6b4820ecb3797f61ab919efb4 for this code in a compiling branch)

When I try this, I sometimes get success - everything works as intended, but more often than not, I get this error:

[error] a.s.Materializer - [actorPublisher] Upstream failed.
akka.stream.impl.ActorPublisher$NormalShutdownException: Cannot subscribe to shut-down Publisher

...the intermittent nature of the error suggests to me that there's some kind of race-condition going on, with the publisher often getting shut-down before it can be registered for use. What's the proper way to use this stuff?!

https://www.playframework.com/documentation/2.5.x/ScalaComet

cc @wsargent

unresolved dependencies

1 ) download 2.6 or 2.7 version
2') $ rm -rf .ivy2/
2) $ sbt run
3)

[info] Loading settings for project play-scala-streaming-example-2-7-x-build from plugins.sbt ...
[info] Loading project definition from /Users/fire/Code/projects/UPMC/play-scala-streaming-example-2.7.x/project
[info] Updating ProjectRef(uri("file:/Users/fire/Code/projects/UPMC/play-scala-streaming-example-2.7.x/project/"), "play-scala-streaming-example-2-7-x-build")...
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	::          UNRESOLVED DEPENDENCIES         ::
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	:: com.typesafe.play#sbt-plugin;2.7.0: Resolution failed several times for dependency: com.typesafe.play#sbt-plugin;2.7.0 {compile=[default(compile)]}::
[warn] 	typesafe-ivy-releases: unable to get resource for com.typesafe.play#sbt-plugin;2.7.0: res=https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.0/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	sbt-plugin-releases: unable to get resource for com.typesafe.play#sbt-plugin;2.7.0: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.0/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	:: org.scala-lang#scala-library;2.12.7: Resolution failed several times for dependency: org.scala-lang#scala-library;2.12.7 {scala-tool=[default, optional(default)], provided=[default(compile)]}::
[warn] 	typesafe-ivy-releases: unable to get resource for org.scala-lang#scala-library;2.12.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-library/2.12.7/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	sbt-plugin-releases: unable to get resource for org.scala-lang#scala-library;2.12.7: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-lang/scala-library/2.12.7/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	typesafe-ivy-releases: unable to get resource for org.scala-lang#scala-library;2.12.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-library/2.12.7/jars/scala-library.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	:: org.scala-sbt#sbt;1.2.8: Resolution failed several times for dependency: org.scala-sbt#sbt;1.2.8 {provided=[default(compile)]}::
[warn] 	typesafe-ivy-releases: unable to get resource for org.scala-sbt#sbt;1.2.8: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.2.8/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	sbt-plugin-releases: unable to get resource for org.scala-sbt#sbt;1.2.8: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-sbt/sbt/1.2.8/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	typesafe-ivy-releases: unable to get resource for org.scala-sbt#sbt;1.2.8: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.2.8/jars/sbt.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	:: org.scala-lang#scala-compiler;2.12.7: Resolution failed several times for dependency: org.scala-lang#scala-compiler;2.12.7 {scala-tool=[default, optional(default)]}::
[warn] 	typesafe-ivy-releases: unable to get resource for org.scala-lang#scala-compiler;2.12.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-compiler/2.12.7/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	sbt-plugin-releases: unable to get resource for org.scala-lang#scala-compiler;2.12.7: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-lang/scala-compiler/2.12.7/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	typesafe-ivy-releases: unable to get resource for org.scala-lang#scala-compiler;2.12.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-compiler/2.12.7/jars/scala-compiler.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] 	Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn] 		com.typesafe.play:sbt-plugin:2.7.0 (scalaVersion=2.12, sbtVersion=1.0)
[warn]
[warn] 	Note: Unresolved dependencies path:
[warn] 		com.typesafe.play:sbt-plugin:2.7.0 (scalaVersion=2.12, sbtVersion=1.0) (/Users/fire/Code/projects/UPMC/play-scala-streaming-example-2.7.x/project/plugins.sbt#L2-3)
[warn] 		  +- default:play-scala-streaming-example-2-7-x-build:0.1.0-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
[warn] 		org.scala-lang:scala-library:2.12.7 ((sbt.Classpaths.jvmBaseSettings) Defaults.scala#L2207)
[warn] 		  +- default:play-scala-streaming-example-2-7-x-build:0.1.0-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
[warn] 		org.scala-sbt:sbt:1.2.8
[warn] 		  +- default:play-scala-streaming-example-2-7-x-build:0.1.0-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
[warn] 		org.scala-lang:scala-compiler:2.12.7
[warn] 		  +- default:play-scala-streaming-example-2-7-x-build:0.1.0-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
[error] sbt.librarymanagement.ResolveException: unresolved dependency: com.typesafe.play#sbt-plugin;2.7.0: Resolution failed several times for dependency: com.typesafe.play#sbt-plugin;2.7.0 {compile=[default(compile)]}::
[error] 	typesafe-ivy-releases: unable to get resource for com.typesafe.play#sbt-plugin;2.7.0: res=https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.0/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	sbt-plugin-releases: unable to get resource for com.typesafe.play#sbt-plugin;2.7.0: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.0/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error]
[error] unresolved dependency: org.scala-lang#scala-library;2.12.7: Resolution failed several times for dependency: org.scala-lang#scala-library;2.12.7 {scala-tool=[default, optional(default)], provided=[default(compile)]}::
[error] 	typesafe-ivy-releases: unable to get resource for org.scala-lang#scala-library;2.12.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-library/2.12.7/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	sbt-plugin-releases: unable to get resource for org.scala-lang#scala-library;2.12.7: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-lang/scala-library/2.12.7/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	typesafe-ivy-releases: unable to get resource for org.scala-lang#scala-library;2.12.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-library/2.12.7/jars/scala-library.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error]
[error] unresolved dependency: org.scala-sbt#sbt;1.2.8: Resolution failed several times for dependency: org.scala-sbt#sbt;1.2.8 {provided=[default(compile)]}::
[error] 	typesafe-ivy-releases: unable to get resource for org.scala-sbt#sbt;1.2.8: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.2.8/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	sbt-plugin-releases: unable to get resource for org.scala-sbt#sbt;1.2.8: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-sbt/sbt/1.2.8/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	typesafe-ivy-releases: unable to get resource for org.scala-sbt#sbt;1.2.8: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.2.8/jars/sbt.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error]
[error] unresolved dependency: org.scala-lang#scala-compiler;2.12.7: Resolution failed several times for dependency: org.scala-lang#scala-compiler;2.12.7 {scala-tool=[default, optional(default)]}::
[error] 	typesafe-ivy-releases: unable to get resource for org.scala-lang#scala-compiler;2.12.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-compiler/2.12.7/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	sbt-plugin-releases: unable to get resource for org.scala-lang#scala-compiler;2.12.7: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-lang/scala-compiler/2.12.7/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	typesafe-ivy-releases: unable to get resource for org.scala-lang#scala-compiler;2.12.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-compiler/2.12.7/jars/scala-compiler.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error]
[error] 	at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:332)
[error] 	at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:208)
[error] 	at sbt.internal.librarymanagement.IvyActions$$$Lambda$2030/971704050.apply(Unknown Source)
[error] 	at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:239)
[error] 	at sbt.internal.librarymanagement.IvySbt$Module$$Lambda$2031/1952931548.apply(Unknown Source)
[error] 	at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:204)
[error] 	at sbt.internal.librarymanagement.IvySbt$$Lambda$2032/887889512.apply(Unknown Source)
[error] 	at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:70)
[error] 	at sbt.internal.librarymanagement.IvySbt$$anon$3.call(Ivy.scala:77)
[error] 	at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
[error] 	at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
[error] 	at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
[error] 	at xsbt.boot.Using$.withResource(Using.scala:10)
[error] 	at xsbt.boot.Using$.apply(Using.scala:9)
[error] 	at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
[error] 	at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
[error] 	at xsbt.boot.Locks$.apply0(Locks.scala:31)
[error] 	at xsbt.boot.Locks$.apply(Locks.scala:28)
[error] 	at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:77)
[error] 	at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:199)
[error] 	at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:196)
[error] 	at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:238)
[error] 	at sbt.internal.librarymanagement.IvyActions$.updateEither(IvyActions.scala:193)
[error] 	at sbt.librarymanagement.ivy.IvyDependencyResolution.update(IvyDependencyResolution.scala:20)
[error] 	at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:56)
[error] 	at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:45)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:93)
[error] 	at sbt.internal.LibraryManagement$$$Lambda$2026/541667089.apply(Unknown Source)
[error] 	at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68)
[error] 	at sbt.util.Tracked$$$Lambda$1987/1502405597.apply(Unknown Source)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$19(LibraryManagement.scala:106)
[error] 	at sbt.internal.LibraryManagement$$$Lambda$2028/1974961563.apply(Unknown Source)
[error] 	at scala.util.control.Exception$Catch.apply(Exception.scala:224)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:106)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:89)
[error] 	at sbt.internal.LibraryManagement$$$Lambda$2025/1214075428.apply(Unknown Source)
[error] 	at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:149)
[error] 	at sbt.util.Tracked$$$Lambda$1936/330808162.apply(Unknown Source)
[error] 	at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:120)
[error] 	at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2561)
[error] 	at sbt.Classpaths$$$Lambda$1121/431097582.apply(Unknown Source)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at scala.Function1$$Lambda$1010/2140617236.apply(Unknown Source)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] 	at sbt.internal.util.$tilde$greater$$Lambda$1846/1955991197.apply(Unknown Source)
[error] 	at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] 	at sbt.Execute$$Lambda$1863/511581051.apply(Unknown Source)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:278)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] 	at sbt.Execute$$Lambda$1854/1133731484.apply(Unknown Source)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] 	at sbt.ConcurrentRestrictions$$anon$4$$Lambda$1861/177267393.apply(Unknown Source)
[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:1142)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] 	at java.lang.Thread.run(Thread.java:745)
[error] (update) sbt.librarymanagement.ResolveException: unresolved dependency: com.typesafe.play#sbt-plugin;2.7.0: Resolution failed several times for dependency: com.typesafe.play#sbt-plugin;2.7.0 {compile=[default(compile)]}::
[error] 	typesafe-ivy-releases: unable to get resource for com.typesafe.play#sbt-plugin;2.7.0: res=https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.0/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	sbt-plugin-releases: unable to get resource for com.typesafe.play#sbt-plugin;2.7.0: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.0/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error]
[error] unresolved dependency: org.scala-lang#scala-library;2.12.7: Resolution failed several times for dependency: org.scala-lang#scala-library;2.12.7 {scala-tool=[default, optional(default)], provided=[default(compile)]}::
[error] 	typesafe-ivy-releases: unable to get resource for org.scala-lang#scala-library;2.12.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-library/2.12.7/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	sbt-plugin-releases: unable to get resource for org.scala-lang#scala-library;2.12.7: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-lang/scala-library/2.12.7/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	typesafe-ivy-releases: unable to get resource for org.scala-lang#scala-library;2.12.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-library/2.12.7/jars/scala-library.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error]
[error] unresolved dependency: org.scala-sbt#sbt;1.2.8: Resolution failed several times for dependency: org.scala-sbt#sbt;1.2.8 {provided=[default(compile)]}::
[error] 	typesafe-ivy-releases: unable to get resource for org.scala-sbt#sbt;1.2.8: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.2.8/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	sbt-plugin-releases: unable to get resource for org.scala-sbt#sbt;1.2.8: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-sbt/sbt/1.2.8/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	typesafe-ivy-releases: unable to get resource for org.scala-sbt#sbt;1.2.8: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.2.8/jars/sbt.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error]
[error] unresolved dependency: org.scala-lang#scala-compiler;2.12.7: Resolution failed several times for dependency: org.scala-lang#scala-compiler;2.12.7 {scala-tool=[default, optional(default)]}::
[error] 	typesafe-ivy-releases: unable to get resource for org.scala-lang#scala-compiler;2.12.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-compiler/2.12.7/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	sbt-plugin-releases: unable to get resource for org.scala-lang#scala-compiler;2.12.7: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scala-lang/scala-compiler/2.12.7/ivys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[error] 	typesafe-ivy-releases: unable to get resource for org.scala-lang#scala-compiler;2.12.7: res=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-compiler/2.12.7/jars/scala-compiler.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q

Example does not work in 2.6.x due to security headers filter

Since 2.6.x the Security Headers filter is enabled automatically. Some default values set to those security headers prevent this example from working in any browser:

  • play.filters.headers.frameOptions - sets X-Frame-Options to “DENY” by default. However, scalacomet.scala.html includes an <iframe />. Obviously browsers block that:
Refused to display 'http://localhost:9000/scala/comet/liveClock?-3483617522062089725' in a frame because it set 'X-Frame-Options' to 'deny'.
  • play.filters.headers.contentSecurityPolicy - sets Content-Security-Policy to “default-src ‘self’” by default. However, there are some inlined scripts executing in a few places.
jquery-1.7.1.min.js:2 Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-p4cncjf0hAIeTSS5tXecf7qTUanDC27KdlKhT9eOsZU='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
jquery-1.7.1.min.js:2 Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-j6Tt8qv7z2kSc7fUs0YHbrxawwsQcS05fVaX1r2qrbk='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
2jquery-1.7.1.min.js:2 Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-4k7ctMEOr0TFHgEsUvTVaR3fsvmZ3jMWlvYe1fVV73k='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
3comet/liveClock?4556151462785380287:1 Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-0+LnLflQCXJoY5zi1zhsk2gWs/h0Z4YQlNEjHS4NxNo='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.

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.