Hello,
I'm trying to install a cluster with BlazeDS. After some difficulties,
I've reached a point where my 2 servers A and B know each other, and
that when a client subscribe on a destination on server A, this server
send a message to the server B.
Unfortunately, this does not work and I've got this error:
--------------------------------
[BlazeDS]09/18/2008 [ERROR] [Service.Cluster] Error handling message
pushed from cluster: java.lang.NullPointerException
[BlazeDS]09/18/2008 [ERROR] [Service.Cluster]
Exception=java.lang.NullPointerException
at
flex.messaging.services.MessageService.subscribeFromPeer(MessageService.java:747)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
flex.messaging.cluster.JGroupsCluster$ServiceOperationHandler.handleBroadcast(JGroupsCluster.java:538)
at flex.messaging.cluster.JGroupsCluster.handle(JGroupsCluster.java:417)
at
org.jgroups.blocks.MessageDispatcher.handle(MessageDispatcher.java:577)
at
org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:624)
at
org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:533)
at
org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:365)
at
org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:736)
at org.jgroups.JChannel.up(JChannel.java:1063)
at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:325)
at org.jgroups.protocols.pbcast.GMS.up(GMS.java:722)
at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234)
at org.jgroups.protocols.pbcast.NAKACK.handleMessage(NAKACK.java:720)
at org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:546)
at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:167)
at org.jgroups.protocols.FD.up(FD.java:322)
at org.jgroups.protocols.MERGE2.up(MERGE2.java:145)
at org.jgroups.protocols.Discovery.up(Discovery.java:220)
at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1486)
at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1440)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[Incoming Thread,default-cluster,10.193.137.195:7800] ERROR
org.jgroups.blocks.RequestCorrelator - error invoking method
flex.messaging.cluster.ClusterException: Unable to replicate a service
operation received from a broadcast on cluster id 'default-cluster'.
at
flex.messaging.cluster.JGroupsCluster$ServiceOperationHandler.handleBroadcast(JGroupsCluster.java:552)
at flex.messaging.cluster.JGroupsCluster.handle(JGroupsCluster.java:417)
at
org.jgroups.blocks.MessageDispatcher.handle(MessageDispatcher.java:577)
at
org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:624)
at
org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:533)
at
org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:365)
at
org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:736)
at org.jgroups.JChannel.up(JChannel.java:1063)
at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:325)
at org.jgroups.protocols.pbcast.GMS.up(GMS.java:722)
at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234)
at org.jgroups.protocols.pbcast.NAKACK.handleMessage(NAKACK.java:720)
at org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:546)
at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:167)
at org.jgroups.protocols.FD.up(FD.java:322)
at org.jgroups.protocols.MERGE2.up(MERGE2.java:145)
at org.jgroups.protocols.Discovery.up(Discovery.java:220)
at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1486)
at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1440)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
--------------------------------
The destination is dynamically created, with these lines:
--------------------------------
MessageService service = getService();
MessageDestination destination = (MessageDestination)
service.getDestination(destinationId);
// set the cluster config
ServerSettings serverSettings = new ServerSettings();
serverSettings.setBroadcastRoutingMode("server-to-server");
NetworkSettings netSettings = new NetworkSettings();
netSettings.setClusterId("default-cluster");
if (destination == null) {
destination = (MessageDestination)
service.createDestination(destinationId);
}
destination.setServerSettings(serverSettings);
destination.setNetworkSettings(netSettings);
if (service.isStarted()) {
destination.start();
}
--------------------------------
Also I do not see any activity on the other destination I have created
with xml configuration files. Here is it:
--------------------------------
<destination id="user-destination">
<properties>
<network>
<session-timeout>0</session-timeout>
<cluster ref="default-cluster" shared-backend="true"/>
</network>
<server>
<max-cache-size>1000</max-cache-size>
<message-time-to-live>0</message-time-to-live>
<durable>false</durable>
<cluster-message-routing>server-to-server</cluster-message-routing>
</server>
</properties>
</destination>
--------------------------------
I am using BlazeDS 3.0.0.544 with JGroup 2.5.1. I have a hardware
load-balancer in front of my 2 servers.
I have googled some good tutorials or examples about BlazeDS
clustering but the only source I've found is the BlazeDS Guide, which
does not really help me. If someone can help me, it will be great.
Thanks in advance,
Fabien
PS: sorry if there is some mistake in my english... :)