Bug 53607

Summary: No message set for PING: TcpPingInterceptor fail with NullPointerException in ChannelData.getDataPackageLength()
Product: Tomcat 6 Reporter: F.Arnoud <frederic.arnoud>
Component: ClusterAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: default   
Hardware: PC   
OS: All   

Description F.Arnoud 2012-07-26 18:33:54 UTC
I added 
        data.setMessage(new XByteBuffer(TCP_PING_DATA, false));

to TcpPingInterceptor send ping message function by:

    protected void sendPingMessage(Member[] members) {
        if ( members == null || members.length == 0 ) return;
        ChannelData data = new ChannelData(true);//generates a unique Id
        data.setAddress(getLocalMember(false));
        data.setTimestamp(System.currentTimeMillis());
        data.setOptions(getOptionFlag());
        data.setMessage(new XByteBuffer(TCP_PING_DATA, false));
        try {
            super.sendMessage(members, data, null);
        }catch (ChannelException x) {
            log.warn("Unable to send TCP ping.",x);
        }
    }


error also for Tomcat 6
regards
fred
Comment 1 Keiichi Fujino 2012-07-31 08:29:05 UTC
Thanks for the patch.
Fixed in trunk and 7.0.x and will be included in 7.0.30 onwards.
Proposed for 6.0.x.
Comment 2 Mark Thomas 2012-08-27 21:41:07 UTC
Fixed in 6.0.x and will be included in 6.0.36 onwards.