Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B79D10F4D for ; Sat, 19 Oct 2013 15:21:02 +0000 (UTC) Received: (qmail 43031 invoked by uid 500); 19 Oct 2013 15:20:58 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 42998 invoked by uid 500); 19 Oct 2013 15:20:57 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 42989 invoked by uid 99); 19 Oct 2013 15:20:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Oct 2013 15:20:56 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bob.deremer@thingworx.com designates 207.46.163.239 as permitted sender) Received: from [207.46.163.239] (HELO na01-by2-obe.outbound.protection.outlook.com) (207.46.163.239) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Oct 2013 15:20:49 +0000 Received: from BLUPR06MB193.namprd06.prod.outlook.com (10.242.191.143) by BLUPR06MB193.namprd06.prod.outlook.com (10.242.191.143) with Microsoft SMTP Server (TLS) id 15.0.785.10; Sat, 19 Oct 2013 15:20:25 +0000 Received: from BLUPR06MB193.namprd06.prod.outlook.com ([169.254.13.240]) by BLUPR06MB193.namprd06.prod.outlook.com ([169.254.13.179]) with mapi id 15.00.0785.001; Sat, 19 Oct 2013 15:20:25 +0000 From: Bob DeRemer To: "dev@tomcat.apache.org" Subject: possible tomcat 7.0.47 jsr-356 bug: NULL pointer being thrown when DecodeException is caught in PojoMessageHandlerWholeBase.onMessage Thread-Topic: possible tomcat 7.0.47 jsr-356 bug: NULL pointer being thrown when DecodeException is caught in PojoMessageHandlerWholeBase.onMessage Thread-Index: Ac7M3qrh4oI3TAgQQl6lSZBXFT64WA== Date: Sat, 19 Oct 2013 15:20:24 +0000 Message-ID: <424bef52c5ee41ee84299076f4816252@BLUPR06MB193.namprd06.prod.outlook.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [98.237.127.73] x-forefront-prvs: 00046D390F x-forefront-antispam-report: SFV:NSPM;SFS:(50944004)(164054003)(5423002)(57704003)(189002)(199002)(80976001)(19580395003)(19580405001)(83322001)(77096001)(16601075003)(74366001)(53806001)(76796001)(81342001)(51856001)(15202345003)(15975445006)(74706001)(18206015023)(69226001)(81542001)(19300405004)(17760045001)(76576001)(54356001)(76786001)(46102001)(33646001)(76176001)(56816003)(83072001)(4396001)(66066001)(65816001)(80022001)(74662001)(47446002)(74502001)(31966008)(81816001)(63696002)(79102001)(59766001)(77982001)(74876001)(85306002)(76482001)(74316001)(81686001)(47976001)(56776001)(49866001)(16236675002)(47736001)(50986001)(54316002)(213903007)(24736002);DIR:OUT;SFP:;SCL:1;SRVR:BLUPR06MB193;H:BLUPR06MB193.namprd06.prod.outlook.com;CLIP:98.237.127.73;FPR:;RD:InfoNoRecords;MX:1;A:1;LANG:en; Content-Type: multipart/related; boundary="_004_424bef52c5ee41ee84299076f4816252BLUPR06MB193namprd06pro_"; type="multipart/alternative" MIME-Version: 1.0 X-OriginatorOrg: thingworx.com X-Virus-Checked: Checked by ClamAV on apache.org --_004_424bef52c5ee41ee84299076f4816252BLUPR06MB193namprd06pro_ Content-Type: multipart/alternative; boundary="_000_424bef52c5ee41ee84299076f4816252BLUPR06MB193namprd06pro_" --_000_424bef52c5ee41ee84299076f4816252BLUPR06MB193namprd06pro_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sorry, accidentally posted this to USERS, when it should be here in DEV I am testing what happens when Encode/Decode Exceptions occur during JSR-35= 6 communication and found that in the following code in onMessage, the ((Ws= Session)session) is NULL. As a result, the actual DecodeException (cause) = is lost. // Can this message be decoded? Object payload; try { payload =3D 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 =3D new MessageHandlerResult( new PojoMessageHandlerWholeText(listener, m, null, endpointConfig, decoderMatch.getTextDecoders(), new Object[= 1], 0, false, -1, -1), MessageHandlerResultType.TEXT); results.add(result); } Is this a bug, or do I need to do something else to get this internal sessi= on initialize - in addition to calling: addMessageHandler(this) in the onOp= en of my Endpoint-derived class? Thanks, Bob DeRemer Senior Director, Architecture and Development [Description: Description: Description: Description: cid:image001.png@01CBE= 3DE.51A12030] http://www.thingworx.com Skype: bob.deremer.thingworx O: 610.594.6200 x812 M: 717.881.3986 --_000_424bef52c5ee41ee84299076f4816252BLUPR06MB193namprd06pro_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Sorry, accidentally posted this to USERS, when it sh= ould be here in DEV

 

I am testing what happens when Encode/Decode Excepti= ons occur during JSR-356 communication and found that in the following code= in onMessage, the ((WsSession)session) is NULL.  As a result, the act= ual DecodeException (cause) is lost.

 

   = ;    // Can this message be decoded?

   = ;     Object payload;

   = ;     try {

   = ;         payload =3D decode(messag= e);

   = ;     } 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 =3D new MessageHandlerResult(

   = ;            &n= bsp;        new PojoMessageHandlerWholeText(listener, = m, null,

   = ;            &n= bsp;            = ;    endpointConfig,

   = ;            &n= bsp;            = ;    decoderMatch.getTextDecoders(), new Object[1],

   = ;            &n= bsp;            = ;    0, false, -1, -1),

   = ;            &n= bsp;        MessageHandlerResultType.TEXT);

   = ;             r= esults.add(result);

        = ;    }

 

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

 

Thanks,

 

 

Bob DeRemer

Senior Director, Architec= ture and Development

 

3D"Description:

http://www.thingworx.com

Skype: bob.deremer.thingworx=

O: 610.594.6200 x812

M: 717.881.3986

 

--_000_424bef52c5ee41ee84299076f4816252BLUPR06MB193namprd06pro_-- --_004_424bef52c5ee41ee84299076f4816252BLUPR06MB193namprd06pro_--