activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From miniman <benjamin.cuthb...@db.com>
Subject NullPointerException when trying to set String propertyu
Date Thu, 01 Feb 2007 12:08:32 GMT

All i am trying to put in a string property on my published messages that i
can group messages together, so that when messages come into the receiver i
can check what type of message it is, and filter on them.

When i try this i get this error.

	Message message = null;
	        	ObjectMessage objMSG = (ObjectMessage)message;
objMSG.setObject(newMsgObj);
				objMSG.setStringProperty("ALERTTYPE", "NEW"); 
remote.send(objMSG, new ActiveMQQueue("Test"));


766 [ActiveMQ Session Task] WARN org.apache.activemq.ActiveMQMessageConsumer 
- Exception while processing message: java.lang.NullPointerException
java.lang.NullPointerException
	at
com.db.abmonitor.client.dataimporter.ConsumerTool.onMessage(ConsumerTool.java:145)

So when i look at that code i have

			if (message instanceof ObjectMessage) {
				ObjectMessage objMsg = (ObjectMessage)message;
				//eventMSG = (MonitorMSG)objMsg.getObject();			
				if(objMsg.getStringProperty("ALERTTYPE").equals("ACK")) {
					// process the ack.
-- 
View this message in context: http://www.nabble.com/NullPointerException-when-trying-to-set-String-propertyu-tf3154471.html#a8747103
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message