That's a Play question, so please ask in the Play community:
https://groups.google.com/forum/#!forum/play-framework

This forum is called Akka-user, so yeah, we talk about Akka specifically
here ;-)

-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 23 March 2017 at 09:53:17, kant kodali ([email protected]) wrote:

Hi All,

I originally posted this question on SO and tried it myself but unable to
find what I am  doing wrong? I get the following error. I followed this
documentation
https://www.playframework.com/documentation/2.5.x/JavaWebSockets.


[error] /Users/hello/Documents/java/test_app/conf/routes:8: Cannot use a
method returning play.mvc.WebSocket[?0] as a Handler for requests

[error] GET     /txstatus
controllers.Application.handleWebSocketConnection()

[error] /Users/hello/Documents/java/test_app/conf/routes:8: not enough
arguments for method createInvoker: (implicit hif:
play.core.routing.HandlerInvokerFactory[play.mvc.WebSocket[?0]])play.core.routing.HandlerInvoker[play.mvc.WebSocket[?0]].

[error] two errors found

[error] (compile:compile) Compilation failed




*Here is the problem Description:*




GET    /status        controllers.Application.handleWebSocketConnection()

Here is the relevant source code.

public WebSocket handleWebSocketConnection() {
    return WebSocket.withActor(new F.Function<ActorRef, Props>() {
        @Override
        public Props apply(ActorRef actorRef) throws Throwable {
            return UserActor.props(actorRef, "");
        }
    });}

here is my build.sbt

import play.routes.compiler.InjectedRoutesGeneratorimport play.sbt.PlayScala

name := "hello"

version := "1.0"

lazy val `dashboard` = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.8"

libraryDependencies ++= Seq(
  jdbc ,
  cache ,
  ws   ,
  specs2 % Test,
  "io.netty" % "netty-all" % "4.0.0")

unmanagedResourceDirectories in Test <+=  baseDirectory ( _
/"target/web/public/test" )

resolvers ++= Seq(
  "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases";)

routesGenerator := InjectedRoutesGenerator

fork in run := true

I am using Play version 2.4.2 and all the source code is in java 8. I get
the following error

Cannot use a method returning play.mvc.WebSocket[?0] as a Handler for requests

any ideas?

Thanks!
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups
"Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to