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 configure Auth with WebSocket server #48

Open
vasicvuk opened this issue Dec 1, 2018 · 0 comments
Open

Cannot configure Auth with WebSocket server #48

vasicvuk opened this issue Dec 1, 2018 · 0 comments

Comments

@vasicvuk
Copy link

vasicvuk commented Dec 1, 2018

I have added HttpServer with WebSocket handler for STOMPSever like this:

  Vertx vertx = Vertx.vertx();
        
        StompServerHandler handler = StompServerHandler.create(vertx).authProvider(new AuthenticationProvider());
        StompServer server = StompServer.create(vertx, 
                    new StompServerOptions()
                            .setSecured(true)
                            .setWebsocketBridge(true)
                           // .setPort(-1)
                            .setWebsocketPath("/broker/stomp")
                )
                .handler(handler)
                .listen(61613, "0.0.0.0");

        HttpServer http = vertx.createHttpServer(
                new HttpServerOptions().setWebsocketSubProtocols("v10.stomp, v11.stomp, v12.stomp")
        )
                .websocketHandler(server.webSocketHandler())
                
                .listen(61614);

But i get exception:

SEVERE: Unhandled exception
java.lang.NullPointerException
	at io.vertx.ext.stomp.impl.DefaultStompHandler.onAuthenticationRequest(DefaultStompHandler.java:437)
	at io.vertx.ext.stomp.DefaultConnectHandler.authenticate(DefaultConnectHandler.java:86)
	at io.vertx.ext.stomp.DefaultConnectHandler.handle(DefaultConnectHandler.java:70)
	at io.vertx.ext.stomp.DefaultConnectHandler.handle(DefaultConnectHandler.java:41)
	at io.vertx.ext.stomp.impl.DefaultStompHandler.handleConnect(DefaultStompHandler.java:379)
	at io.vertx.ext.stomp.impl.DefaultStompHandler.handle(DefaultStompHandler.java:235)
	at io.vertx.ext.stomp.impl.DefaultStompHandler.handle(DefaultStompHandler.java:66)
	at io.vertx.ext.stomp.impl.StompServerImpl.lambda$null$13(StompServerImpl.java:237)
	at io.vertx.ext.stomp.impl.FrameParser.handleLine(FrameParser.java:164)
	at io.vertx.core.parsetools.impl.RecordParserImpl.parseDelimited(RecordParserImpl.java:202)
	at io.vertx.core.parsetools.impl.RecordParserImpl.handleParsing(RecordParserImpl.java:176)
	at io.vertx.core.parsetools.impl.RecordParserImpl.handle(RecordParserImpl.java:235)
	at io.vertx.ext.stomp.impl.FrameParser.handle(FrameParser.java:221)
	at io.vertx.ext.stomp.impl.FrameParser.handle(FrameParser.java:35)
	at io.vertx.core.http.impl.WebSocketImplBase.handleFrame(WebSocketImplBase.java:268)
	at io.vertx.core.http.impl.Http1xServerConnection.handleOther(Http1xServerConnection.java:499)
	at io.vertx.core.http.impl.Http1xServerConnection.processMessage(Http1xServerConnection.java:460)
	at io.vertx.core.http.impl.Http1xServerConnection.handleMessage(Http1xServerConnection.java:144)
	at io.vertx.core.http.impl.HttpServerImpl$ServerHandlerWithWebSockets.handleMessage(HttpServerImpl.java:676)
	at io.vertx.core.http.impl.HttpServerImpl$ServerHandlerWithWebSockets.handleMessage(HttpServerImpl.java:619)
	at io.vertx.core.net.impl.VertxHandler.lambda$channelRead$1(VertxHandler.java:146)
	at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:337)
	at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:195)
	at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:144)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:141)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)

when i try to login from STOMP over web socket

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

No branches or pull requests

1 participant