activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From miniman <>
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.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

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:
Sent from the ActiveMQ - User mailing list archive at

View raw message