You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2013/10/20 19:37:21 UTC

[Bug 55681] New: JSR-356 message handling: NULL pointer being thrown when DecodeException is caught in PojoMessageHandlerWholeBase.onMessage

https://issues.apache.org/bugzilla/show_bug.cgi?id=55681

            Bug ID: 55681
           Summary: JSR-356 message handling: NULL pointer being thrown
                    when DecodeException is caught in
                    PojoMessageHandlerWholeBase<T>.onMessage
           Product: Tomcat 7
           Version: trunk
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Servlet & JSP API
          Assignee: dev@tomcat.apache.org
          Reporter: bob.deremer@thingworx.com

I am testing what happens when Encode/Decode Exceptions occur during JSR-356
communication.  In our case, we do NOT use annotation, but we "extend Endpoint"
and "implement Whole<ThingworxMessage>".  I was forcing a DecodeException to
occur - expecting to my onError to be called with the actual DecodeException. 
Instead, I got a Null.  

Stepping the following code in Tomcat:

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);
            return;
        }


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,
                                endpointConfig,
                                decoderMatch.getTextDecoders(), new Object[1],
                                0, false, -1, -1),
                        MessageHandlerResultType.TEXT);
                results.add(result);
            }

Please let me know if I can provide any more details.

-bob

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55681] JSR-356 message handling: NULL pointer being thrown when DecodeException is caught in PojoMessageHandlerWholeBase.onMessage

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55681

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
Whoops. That should be 7.0.48

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55681] JSR-356 message handling: NULL pointer being thrown when DecodeException is caught in PojoMessageHandlerWholeBase.onMessage

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55681

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
                 OS|                            |All

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Fixed in trunk for 8.0.0-RC6 onwards and in 7.0.x for 7.0.78 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org