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

Jetty and Websocket, warning abotu status code >400 #349

Closed
survivant opened this issue May 9, 2012 · 1 comment
Closed

Jetty and Websocket, warning abotu status code >400 #349

survivant opened this issue May 9, 2012 · 1 comment

Comments

@survivant
Copy link
Member

I received lot of WARN about this : 

87625 [qtp9820728-21] WARN org.atmosphere.websocket.protocol.SimpleHttpProtocol - Status code higher than 400 Status 400 Message Invalid websocket transport request

but my status code is = 400.

here the code

/**
     * Dispatch to request/response to the {@link org.atmosphere.cpr.AsyncSupport} implementation as it was a normal HTTP request.
     *
     * @param request a {@link AtmosphereRequest}
     * @param r       a {@link AtmosphereResponse}
     */
    protected final void dispatch(final AtmosphereRequest request, final AtmosphereResponse r) {
        if (request == null) return;
        try {
            framework.doCometSupport(request, r);
        } catch (Throwable e) {
            logger.warn("Failed invoking AtmosphereFramework.doCometSupport()", e);
            webSocketProtocol.onError(webSocket, new WebSocketException(e,
                    new AtmosphereResponse.Builder()
                            .request(request)
                            .status(500)
                            .statusMessage("Server Error").build()));
            return;
        }

        AtmosphereResource resource = (AtmosphereResource) request.getAttribute(FrameworkConfig.ATMOSPHERE_RESOURCE);

        if (r.getStatus() >= 400) {
            webSocketProtocol.onError(webSocket, new WebSocketException("Status code higher than 400", r));
        }

        if (webSocket.resource() == null && WebSocketAdapter.class.isAssignableFrom(webSocket.getClass())) {
            WebSocketAdapter.class.cast(webSocket).setAtmosphereResource(resource);
        }
    }

here the stack


Thread [qtp9820728-16] (Suspended (breakpoint at line 151 in SimpleHttpProtocol))   
    SimpleHttpProtocol.onError(WebSocket, WebSocketProcessor$WebSocketException) line: 151  
    WebSocketProcessor.dispatch(AtmosphereRequest, AtmosphereResponse) line: 192    
    WebSocketProcessor$2.run() line: 153    
    VoidExecutorService.execute(Runnable) line: 101 
    WebSocketProcessor.dispatch(List<AtmosphereRequest>) line: 148  
    WebSocketProcessor.invokeWebSocketProtocol(String) line: 136    
    JettyWebSocketHandler.onMessage(String) line: 110   
    WebSocketConnectionD08$WSFrameHandler.onFrame(byte, byte, Buffer) line: 749 
    WebSocketParserD08.parseNext() line: 347    
    WebSocketServletConnectionD08(WebSocketConnectionD08).handle() line: 204    
    SelectChannelEndPoint.handle() line: 606    
    SelectChannelEndPoint$1.run() line: 46  
    QueuedThreadPool.runJob(Runnable) line: 603 
    QueuedThreadPool$3.run() line: 538  
    Thread.run() line: not available    
jfarcand added a commit that referenced this issue May 9, 2012
@jfarcand
Copy link
Member

jfarcand commented May 9, 2012

Thanks

@jfarcand jfarcand closed this as completed May 9, 2012
jfarcand added a commit that referenced this issue May 30, 2012
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

2 participants