Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find org.atmosphere.play.Router #39

Closed
bb-work opened this issue Jul 12, 2016 · 9 comments
Closed

Cannot find org.atmosphere.play.Router #39

bb-work opened this issue Jul 12, 2016 · 9 comments

Comments

@bb-work
Copy link

bb-work commented Jul 12, 2016

Compilation fails for Play! chat sample as downloaded from atmosphere-samples site, no modifications. Using Play! 2.5.4

bba0124$ activator compile
[info] Loading project definition from /Users/bba0124/Downloads/atmosphere-samples-master/play-samples/chat/project
[info] Set current project to chat (in build file:/Users/bba0124/Downloads/atmosphere-samples-master/play-samples/chat/)
[info] Compiling 3 Scala sources and 7 Java sources to /Users/bba0124/Downloads/atmosphere-samples-master/play-samples/chat/target/scala-2.11/classes...
[error] /Users/bba0124/Downloads/atmosphere-samples-master/play-samples/chat/app/Global.java:21: error: cannot find symbol
[error] import org.atmosphere.play.Router;
[error] ^
[error] symbol: class Router
[error] location: package org.atmosphere.play
[error] /Users/bba0124/Downloads/atmosphere-samples-master/play-samples/chat/app/Global.java:40: error: cannot find symbol
[error] return Router.dispatch(request);
[error] ^
[error] symbol: variable Router
[error] location: class Global
[error] 2 errors
error javac returned nonzero exit code
[error] Total time: 5 s, completed Jul 12, 2016 2:06:17 PM

@bb-work
Copy link
Author

bb-work commented Jul 12, 2016

So I eventualy deduced that this was a deprecated function. Still, updating your examples would be useful!!

@bb-work bb-work closed this as completed Jul 12, 2016
@jfarcand
Copy link
Member

Pull request welcomed!

@bb-work
Copy link
Author

bb-work commented Jul 12, 2016

If I could actually figure out how to make this stuff work, maybe I would. It would help to have an actual working example, though!

@jfarcand
Copy link
Member

I understand...but I don't have the cycle to help right now. Maybe @stegmann-idnow

@ghost
Copy link

ghost commented Jul 13, 2016

Hey, the play's GlobalSettings class is deprecated and will be removed.
For play 2.5 you have to define a request handler instead.

If you configure the following in the application.conf it should work:
play.http.requestHandler = "org.atmosphere.play.AtmosphereHttpRequestHandler"

And of course you have to remove the onRouteRequest method in your Global.java.

I try to migrate the chat example in the next days.

@bb-work
Copy link
Author

bb-work commented Jul 13, 2016

OK, that got rid of the compilation error, but the web socket doesn't connect:

WebSocket connection to 'ws://localhost:9000/chat?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.3.2-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&Content-Type=application/json&X-atmo-protocol=true' failed: Error during WebSocket handshake: Unexpected response code: 404

From: stegmann-idnow <notifications@github.commailto:notifications@github.com>
Reply-To: Atmosphere/atmosphere-play <reply@reply.github.commailto:reply@reply.github.com>
Date: Wednesday, July 13, 2016 at 11:37 AM
To: Atmosphere/atmosphere-play <atmosphere-play@noreply.github.commailto:atmosphere-play@noreply.github.com>
Cc: Benagh Betsey <betsey.benagh@stresearch.commailto:betsey.benagh@stresearch.com>, State change <state_change@noreply.github.commailto:state_change@noreply.github.com>
Subject: Re: [Atmosphere/atmosphere-play] Cannot find org.atmosphere.play.Router (#39)

Hey, the play's GlobalSettings class is deprecated and will be removed.
For play 2.5 you have to define a request handler instead.

If you configure the following in the application.conf it should work:
play.http.requestHandler = "org.atmosphere.play.AtmosphereHttpRequestHandler"

And of course you have to remove the onRouteRequest method in your Global.java.

I try to migrate the chat example in the next days.

You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHubhttps://github.com//issues/39#issuecomment-232394634, or mute the threadhttps://github.com/notifications/unsubscribe/AQWbpQgXHcVpePEpEaZ6oYTTfvQY2fp6ks5qVQYwgaJpZM4JKqeM.

@DeveloperInResidence
Copy link

I'm having the same problem, though I'm using HTTPS, so I've added play.https.requestHandler = "org.atmosphere.play.AtmosphereHttpRequestHandler" to my application.conf.
Still, I get a 404 error when I try to connect (trying websockets first, falling back on long-polling).
Has anyone been able to use the ManagedService with Play at all?

@bb-work
Copy link
Author

bb-work commented Dec 12, 2016 via email

@DeveloperInResidence
Copy link

Thank you! The instance.discover part in the controller solved that problem for me.
Now I've got a different problem which I can't find any good solution for, but perhaps you have encountered when using Play?

I'm trying to authenticate access to the ManagedService, but the Authenticated annotation doesn't seem to work on methods in that class, nor can I access the Play session.
I've tried enabling the Play session by using a class implementing the AtmospherePlaySessionConverter, but due to classloading issues it appears it cannot be used in development mode. Have you perhaps found a way to do authentication or access the Play session in development mode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants