Re: [jgroups-dev] What does cause NullPointerException?

Development issues <[email protected]> Wed, 23 Dec 2015 08:21:26 +0100
Newsgroups gmane.comp.java.javagroups.devel
Message-ID <[email protected]>
What's the stack trace?

I hope you're not reusing the message, as in:

Message msg=new Message(null, "hello world');
for(int i=0; i < 5; i++)
    ch.send(msg);

This is incorrect as the send modifies the message. The correct code 
would be:


for(int i=0; i < 5; i++) {
   Message msg=new Message(null, "hello world');
    ch.send(msg);
}

On 22/12/15 22:39, Development issues wrote:
> I have a cluster consist of 5 machines, 3 allocated for services and 2 for
> clients. I start the cluster and build a channel without any problem. Also
> clients manage to send a request to the servers using channel.send(msg).
>
> However, when I use channel.send(msg) again (in client side), it gives me
> NullPointerException. Moreover, NullPointerException point to line where
> channel.send(msg) is.
>
> Can anyone tell what does cause such problem?
>
> Thank you
>
> Ibrahim


-- 
Bela Ban, JGroups lead (http://www.jgroups.org)


------------------------------------------------------------------------------
_______________________________________________
Javagroups-development mailing list