-
Notifications
You must be signed in to change notification settings - Fork 21
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
Comments
So I eventualy deduced that this was a deprecated function. Still, updating your examples would be useful!! |
Pull request welcomed! |
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! |
I understand...but I don't have the cycle to help right now. Maybe @stegmann-idnow |
Hey, the play's GlobalSettings class is deprecated and will be removed. If you configure the following in the application.conf it should work: 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. |
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> Hey, the play's GlobalSettings class is deprecated and will be removed. If you configure the following in the application.conf it should work: 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. |
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. |
Yes, I have.
My conf file includes:
play.http.requestHandler = "org.atmosphere.play.AtmosphereHttpRequestHandler"
My main application looks like:
```java
import static org.atmosphere.play.AtmosphereCoordinator.instance;
public class Application extends Controller {
@Inject
public Application(ApplicationLifecycle lifecycle){
instance.discover(SelectPolicyHandler.class).ready();
logger.info("Creating Application");
lifecycle.addStopHook(() -> {
instance().shutdown();
return CompletableFuture.completedFuture(null);
});
}
public Result index() {
return ok(index.render());
}
}
```
SelectPolicyHandler is the class with ManagedService.
From: DeveloperInResidence <notifications@github.com<mailto:notifications@github.com>>
Reply-To: Atmosphere/atmosphere-play <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Monday, December 12, 2016 at 3:19 AM
To: Atmosphere/atmosphere-play <atmosphere-play@noreply.github.com<mailto:atmosphere-play@noreply.github.com>>
Cc: Benagh Betsey <betsey.benagh@stresearch.com<mailto:betsey.benagh@stresearch.com>>, State change <state_change@noreply.github.com<mailto:state_change@noreply.github.com>>
Subject: Re: [Atmosphere/atmosphere-play] Cannot find org.atmosphere.play.Router (#39)
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?
-
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub<#39 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AQWbpUAJELpq-ivrXd7Cn0h-CCi8LU9bks5rHQOngaJpZM4JKqeM>.
|
Thank you! The instance.discover part in the controller solved that problem for me. 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. |
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
The text was updated successfully, but these errors were encountered: