tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob DeRemer <>
Subject possible tomcat 7.0.47 jsr-356 bug: NULL pointer being thrown when DecodeException is caught in PojoMessageHandlerWholeBase<T>.onMessage
Date Sat, 19 Oct 2013 12:46:05 GMT
I am testing what happens when Encode/Decode Exceptions occur during JSR-356 communication
and found that in the following code in onMessage, the ((WsSession)session) is NULL.  As a
result, the actual DecodeException (cause) is lost.

       // Can this message be decoded?
        Object payload;
        try {
            payload = decode(message);
        } catch (DecodeException de) {
            ((WsSession) session).getLocal().onError(session, de);

Tracing this further up the stack, I found that Util.getMessageHandlers is initializing it
and passing NULL in for the session:

            if (decoderMatch.getTextDecoders().size() > 0) {
                MessageHandlerResult result = new MessageHandlerResult(
                        new PojoMessageHandlerWholeText(listener, m, null,
                                decoderMatch.getTextDecoders(), new Object[1],
                                0, false, -1, -1),

Is this a bug, or do I need to do something else to get this internal session initialize -
in addition to calling: addMessageHandler(this) in the onOpen of my Endpoint-derived class?


Bob DeRemer
Senior Director, Architecture and Development

[Description: Description: Description: Description: cid:image001.png@01CBE3DE.51A12030]<>
Skype: bob.deremer.thingworx
O: 610.594.6200 x812
M: 717.881.3986

  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message