NullPointerException in MapMessage
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Fergus_Gallagher
Posted On:   Tuesday, August 27, 2002 04:02 AM

I am having problems with an NPE in a MapMessage. For example I have created a MapMessage with a single java.lang.Integer property MapMessage mm = session.createMapMessage(); mm.setObject("key", new Integer(12345)); System.out.println(mm); throws: java.lang.NullPointerException at com.swiftmq.jms.primitives._String.toString(_String.java:46) at java.lang.String.valueOf(String.java:2173) at java.lang.StringBuffer.append(StringBuffer.java:369) at java.util.AbstractMap.toString(AbstractMap.java:585) at com.swiftmq.jms.MessageProperties.toString(MessageProperties.java:344) at java.lang.String.valueOf(String.java:2173) a   More>>

I am having problems with an NPE in a MapMessage. For example I have created a MapMessage with a single java.lang.Integer property

			
MapMessage mm = session.createMapMessage();
mm.setObject("key", new Integer(12345));

System.out.println(mm);


throws:

			
java.lang.NullPointerException
at com.swiftmq.jms.primitives._String.toString(_String.java:46)
at java.lang.String.valueOf(String.java:2173)
at java.lang.StringBuffer.append(StringBuffer.java:369)
at java.util.AbstractMap.toString(AbstractMap.java:585)
at com.swiftmq.jms.MessageProperties.toString(MessageProperties.java:344)
at java.lang.String.valueOf(String.java:2173)
at java.lang.StringBuffer.append(StringBuffer.java:369)
at com.swiftmq.jms.MessageImpl.toString(MessageImpl.java:1540)
at com.swiftmq.jms.MapMessageImpl.toString(MapMessageImpl.java:546)
at java.lang.String.valueOf(String.java:2173)
at java.lang.StringBuffer.append(StringBuffer.java:369)
at .....



I also get a NPE if I just try to send it, without calling toString();



Anyone got any suggestions?


[SwiftMQ 3.2.0 Production; Linux; Sun JDK 1.4.0_01]

   <<Less

Re: NullPointerException in MapMessage

Posted By:   Fergus_Gallagher  
Posted On:   Tuesday, August 27, 2002 04:13 AM

I found the problem - I was actually setting a message PROPERTY to a null value.


Unless this is disallowed by the JMS spec, I would suggest this is bug though....

About | Sitemap | Contact