santhoshvee | 21 Sep 08:43 2009
Picon

JPOS 1.6 null pointer exception

Hi

I was trying to upgrade my JPOS to V1.6.4. However, while running a sample code mentioned in the Jpos Guide
1.6.1, i encountered a null pointed exception  <at> 
java.lang.NullPointerException
    at org.jpos.iso.ISOUtil.str2bcd(ISOUtil.java:323)
    at org.jpos.iso.header.BASE1Header.setSource(BASE1Header.java:105)

I figured out that when i don't set the header i get this exception
ISOMsg m = new ISOMsg ();

		BASE1Header head = new BASE1Header();
		head.setFormat(1);
		head.setSource("000000");
		head.setDestination("000001");
		//m.setHeader(head);
		
		m.setMTI ("0800");
		m.set (3, "000000");
		m.set (41, "00000001");
		m.set (70, "301");

When i uncommented "m.setHeader(head)" it worked just fine. I guess this null pointer exception can be
more gracefully handled.

Cheers
Radhakrishna

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

(Continue reading)


Gmane