[ openjms-Bugs-673993 ] class IntravmSessionStub does not accept null messages.

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.java.openjms.devel
Message-ID <[email protected]>
Bugs item #673993, was opened at 2003-01-24 13:12
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=673993&group_id=54559

Category: client
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Raicho Minev (raicho)
Assigned to: Jim Alateras (jalateras)
Summary: class IntravmSessionStub does not accept null messages.

Initial Comment:

I am using embedded JMS server and intravm jndi for 
connecting.

The problem occurs when the JmsServerSession class 
tries to send a "ping" like isClientEndpointActive() 
request, because it sends a null message. A null pointer 
exception is then thrown by the onMessage method, 
when it tries to clone the message object for the intravm 
client:

public void onMessage(Message message) 
{
...
  try {
     copy = (Message) ((MessageImpl) message).clone();
  } catch (CloneNotSupportedException exception) {
   getLogger().logException(exception);
  }
...
}

I suggest surrounding the clone operation with a "not 
null" check:

public void onMessage(Message message) 
{
...
 if(message != null) {
    try {
     copy = (Message) ((MessageImpl) message).clone ();
    } catch (CloneNotSupportedException exception) {
     getLogger().logException(exception);
    }
 }
...
}

The following methods also clone messages and do not 
check for nulls and will probably have similar porblems:
sendMessage()
receiveMessages()
onMessages()

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=673993&group_id=54559
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.