Thursday, February 19, 2009

BO Map Failure at runtime with null pointer Exception

The issue is the BO Map was failing at runtime giving null ponter exception at a custom map, i got really confused looked every thing in the custom map. All the value was checked to null or it is intialized to default. After doing all this again the same error kept on throwing.

Wait i remember something, i checked the right hand side BO (to BO) to which value needs to be assigned. That particular BO was null. Why this ? :-(

There is a file named map.config.properties which is located in
runtimes/properties/ folder of your WID/WPS installation location. That file has an important property set which is

createChildBOsbyDefault=false




if this is set to false if there is custom mapping where the value needs to set to a particular field of the BO, at first we need to create the BO otherwise there should be move option to that particular. unless the above two occurs the BO will be always null. If you try to assign a value to field in the BO. It will throw null pointer exception (check the above screenshot)

In order to overcome the issue, before doing a custom assign to variable to the BO, first create that BO or make a move. The move should be always before the custom assign (exceution order) check the below screen shot

0 comments: