-
Notifications
You must be signed in to change notification settings - Fork 518
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
Websockets are not initialised error #743
Comments
Hello, you are using the default implementation which is disabled by default. You have to create your own implementation. public class DefaultWebSockets implements WebSockets {
@Override
public boolean isEnabled() {
return false;
}
@Override
public void compileRoute(Route route) {
throw new IllegalStateException("WebSockets are not enabled." +
" Unable to add websocket route to " + route.getUri() + "." +
" Are you running in a websocket-enabled HTTP server?");
}
} |
Is there a practical example of how a custom implementation should look like? Or how websockets are enabled? |
It feels like you aren't using a websocket enabled web container to run it
in, thus Ninja is falling back to the default implementation, which
basically warns you that you aren't running a websocket enabled container.
You can solve this with either adding the dependencies to your project, or
using a different container to run it in. Without knowing much about your
project, what you're running it in, etc., I can't help much more than
that. If you wanna share those details, we can probably point you in a
better direction.
…On Thu, Feb 24, 2022, 10:32 AM SebastianFilip101 ***@***.***> wrote:
Is there a practical example of how a custom implementation should look
like? Or how websockets are enabled?
—
Reply to this email directly, view it on GitHub
<#743 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEPAAUWPDBKIDLIZEEZS7LU4ZFRJANCNFSM5PHHFQSA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to create a WebSocket endpoint with Ninja and by following the documentation provided here I keep getting the same error. I followed the entire documentation step by step. This is the error:
[INFO] GCLOUD: java.lang.IllegalStateException: WebSockets are not enabled. Unable to configure route /api/websocketExample. Using implementation ninja.websockets.DefaultWebSockets
Because of this error the Routes are not initialised either.
Any Ideas?
The text was updated successfully, but these errors were encountered: