Buggy code:
public class JChannelFactory implements ChannelFactory , ChannelListener , ProtocolStackConfigurator { private final ProtocolStackConfiguration configuration ; private final Map < Channel , String > channels = Collections . synchronizedMap ( new WeakHashMap < Channel , String > ( ) ) ; public JChannelFactory ( ProtocolStackConfiguration configuration ) { } @ Override public ServerEnvironment getServerEnvironment ( ) { } @ Override public ProtocolStackConfiguration getProtocolStackConfiguration ( ) { } @ Override public Channel createChannel ( final String id ) throws Exception { JChannel channel = new MuxChannel ( this ) ; TP transport = channel . getProtocolStack ( ) . getTransport ( ) ; if ( transport . isSingleton ( ) ) { synchronized ( transport ) { this . init ( transport ) ; } } else { this . init ( transport ) ; } final RelayConfiguration relayConfig = this . configuration . getRelay ( ) ; if ( relayConfig != null ) { final String localSite = relayConfig . getSiteName ( ) ; final List < RemoteSiteConfiguration > remoteSites = this . configuration . getRelay ( ) . getRemoteSites ( ) ; final List < String > sites = new ArrayList < String > ( ( ( remoteSites . size ( ) ) + 1 ) ) ; sites . add ( localSite ) ; final Map < String , RelayConfig . BridgeConfig > bridges = new HashMap < String , RelayConfig . BridgeConfig > ( ) ; for ( final RemoteSiteConfiguration remoteSite : remoteSites ) { final String siteName = remoteSite . getName ( ) ; sites . add ( siteName ) ; <START_BUG> final String cluster = remoteSite . getCluster ( ) ; <END_BUG> final String clusterName = ( cluster != null ) ? cluster : siteName ; final RelayConfig . BridgeConfig bridge = new RelayConfig . BridgeConfig ( clusterName ) { @ Override public JChannel createChannel ( ) throws Exception { return ( ( JChannel ) ( remoteSite . getChannelFactory ( ) . createChannel ( ( ( id + "//" ) + clusterName ) ) ) ) ; } } ; bridges . put ( clusterName , bridge ) ; } Collections . sort ( sites ) ; final RELAY2 relay = new RELAY2 ( ) . site ( localSite ) ; for ( short i = 0 ; i < ( sites . size ( ) ) ; ++ i ) { final String site = sites . get ( i ) ; RelayConfig . SiteConfig siteConfig = new RelayConfig . SiteConfig ( site , i ) ; relay . addSite ( site , siteConfig ) ; if ( site . equals ( localSite ) ) { for ( RelayConfig . BridgeConfig bridge : bridges . values ( ) ) { siteConfig . addBridge ( bridge ) ; } } } Configurator . resolveAndAssignFields ( relay , relayConfig . getProperties ( ) ) ; Configurator . resolveAndInvokePropertyMethods ( relay , relayConfig . getProperties ( ) ) ; channel . getProtocolStack ( ) . addProtocol ( relay ) ; relay . init ( ) ; } channel . setName ( ( ( ( this . configuration . getEnvironment ( ) . getNodeName ( ) ) + "//" ) + id ) ) ; TransportConfiguration . Topology topology = this . configuration . getTransport ( ) . getTopology ( ) ; if ( topology != null ) { channel . setAddressGenerator ( new TopologyAddressGenerator ( channel , topology . getSite ( ) , topology . getRack ( ) , topology . getMachine ( ) ) ) ; } MBeanServer server = this . configuration . getMBeanServer ( ) ; if ( server != null ) { try { this . channels . put ( channel , id ) ; JmxConfigurator . registerChannel ( channel , server , id ) ; } catch ( Exception e ) { JGroupsLogger . ROOT_LOGGER . warn ( e . getMessage ( ) , e ) ; } channel . addChannelListener ( this ) ; } return channel ; } private void init ( TP transport ) { } @ Override public String getProtocolStackString ( ) { } @ Override public List < ProtocolConfiguration > getProtocolStack ( ) { } private void configureBindAddress ( ProtocolConfiguration protocol , ProtocolConfiguration config , SocketBinding binding ) { } private void configureServerSocket ( ProtocolConfiguration protocol , ProtocolConfiguration config , String property , SocketBinding binding ) { } private void configureMulticastSocket ( ProtocolConfiguration protocol , ProtocolConfiguration config , String addressProperty , String portProperty , SocketBinding binding ) { } private void setPropertyNoOverride ( ProtocolConfiguration protocol , ProtocolConfiguration config , String name , String value ) { } private void setProperty ( ProtocolConfiguration protocol , ProtocolConfiguration config , String name , String value ) { } private ProtocolConfiguration createProtocol ( final ProtocolConfiguration protocolConfig ) { } private void setValue ( Protocol protocol , String property , Object value ) { } @ Override public void channelConnected ( Channel channel ) { } @ Override public void channelDisconnected ( Channel channel ) { } @ Override public void channelClosed ( Channel channel ) { } }

Fix:
final String cluster = remoteSite . getClusterName ( ) ;